Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix building LineageOS #226

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/apps/fdroid.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ in
config = mkIf cfg.enable {
apps.prebuilt."F-Droid" = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like f-droid has been updated:
https://f-droid.org/repo/org.fdroid.fdroid_1019052.apk

nix-prefetch-url 'https://f-droid.org/repo/org.fdroid.fdroid_1019052.apk' --type sha256
path is '/nix/store/rvxz6jcz1cs21hs3k654nf6712ikqn7q-org.fdroid.fdroid_1019052.apk'
0gfyfdqxyc4ynl7vz1h99drvpbardaqzm6zil5ym6xw2s7a3wgyb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's important that we always bake in the latest f-droid. Any version that is capable of updating itself to the latest should work. Setting up automated dependency bumping with something like @dependabot would be nice though.

It looks like f-droid only keeps the last N versions of APKs. So, all such links are doomed to expire eventually. We need to copy them to a more stable mirror. Maybe the Nix/IPFS work will mature soon?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think I found a more stable URL.

https://f-droid.org/archive/org.fdroid.fdroid_1017050.apk

Context: https://f-droid.org/archive/

However, it looks like F-Droid moves the APKs to the archive after some time. So, we will need to specify both a /repo/ and an /archive/ URL as mirrors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Nixpkgs, there is a mirror thingy for fetchers. Perhaps we could utilise that here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just specify an array of strings in a srcs attribute.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apk = pkgs.fetchurl {
url = "https://f-droid.org/repo/org.fdroid.fdroid_1017050.apk";
sha256 = "sha256-3Du4j2QZ7n3efRVHpBVpqgMoL+AODcQ84DXv18nSfXU=";
url = "https://f-droid.org/repo/org.fdroid.fdroid_1019051.apk";
sha256 = "sha256-FiyxS5O9m2Zf/0JWtPyRz+dftyM1oCsdD+vmBiILUPQ=";
};

fingerprint = mkIf (!config.signing.enable) "7352DAE94B237866E7FB44FD94ADE44E8B6E05397E7D1FB45616A00E225063FF";
Expand Down
2 changes: 1 addition & 1 deletion modules/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let
jre = if (config.androidVersion >= 11) then pkgs.jdk11_headless else pkgs.jre8_headless;
deps = with pkgs;
[ otaTools openssl jre zip unzip pkgs.getopt which toybox vboot_reference util-linux
python # ota_from_target_files invokes, brillo_update_payload which has "truncate_file" which invokes python
python3 # ota_from_target_files invokes, brillo_update_payload which has "truncate_file" which invokes python
];
in ''
export PATH=${lib.makeBinPath deps}:$PATH
Expand Down
2 changes: 1 addition & 1 deletion modules/signing.nix
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ in
${config.source.dirs."system/extras".src}/verity/generate_verity_key.c \
${config.source.dirs."system/core".src}/libcrypto_utils/android_pubkey.c${lib.optionalString (config.androidVersion >= 12) "pp"} \
-I ${config.source.dirs."system/core".src}/libcrypto_utils/include/ \
-I ${pkgs.boringssl}/include ${pkgs.boringssl}/lib/libssl.a ${pkgs.boringssl}/lib/libcrypto.a -lpthread
-I ${pkgs.boringssl.dev}/include ${pkgs.boringssl}/lib/libssl.a ${pkgs.boringssl}/lib/libcrypto.a -lpthread

cp ${config.source.dirs."external/avb".src}/avbtool $out/bin/avbtool

Expand Down
17 changes: 0 additions & 17 deletions pkgs/fetchgit/builder.sh

This file was deleted.

94 changes: 0 additions & 94 deletions pkgs/fetchgit/default.nix

This file was deleted.