From a26f2a58d1e4a468cbc0271d6c66565664344475 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 10 Sep 2022 10:42:04 +0100 Subject: [PATCH 1/2] update paths in web.yml --- .github/workflows/web.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 807a75af1b..f29f118ecc 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -9,7 +9,7 @@ on: - website/** - images/** - blog/** - - simplex-chat/.github/workflows/web.yml + - .github/workflows/web.yml jobs: build: From 0af50317908f3cef6211fb7e578da1f954ae898e Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 10 Sep 2022 16:57:40 +0100 Subject: [PATCH 2/2] nix: re-use ios post install script (#1035) --- flake.nix | 94 +++++++++++++------------------------------------------ 1 file changed, 22 insertions(+), 72 deletions(-) diff --git a/flake.nix b/flake.nix index eab982de5d..514292f758 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,24 @@ > $out/nix-support/hydra-build-products ''; }); in + let iosPostInstall = bundleName: '' + ${pkgs.tree}/bin/tree $out + mkdir -p $out/_pkg + # copy over includes, we might want those, but maybe not. + # cp -r $out/lib/*/*/include $out/_pkg/ + # find the libHS...ghc-X.Y.Z.a static library; this is the + # rolled up one with all dependencies included. + find ./dist -name "libHS*.a" -exec cp {} $out/_pkg \; + find ${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib -name "*.a" -exec cp {} $out/_pkg \; + find ${pkgs.gmp6.override { withStatic = true; }}/lib -name "*.a" -exec cp {} $out/_pkg \; + # There is no static libc + ${pkgs.tree}/bin/tree $out/_pkg + (cd $out/_pkg; ${pkgs.zip}/bin/zip -r -9 $out/${bundleName}.zip *) + rm -fR $out/_pkg + mkdir -p $out/nix-support + echo "file binary-dist \"$(echo $out/*.zip)\"" \ + > $out/nix-support/hydra-build-products + ''; in rec { packages = { "lib:simplex-chat" = (drv pkgs).simplex-chat.components.library; @@ -225,24 +243,7 @@ # for iOS we also use -staticlib, to get one rolled up library. # still needs mac2ios patching of the archives. ghcOptions = [ "-staticlib" "-threaded" "-DIOS" ]; - postInstall = '' - ${pkgs.tree}/bin/tree $out - mkdir -p $out/_pkg - # copy over includes, we might want those, but maybe not. - # cp -r $out/lib/*/*/include $out/_pkg/ - # find the libHS...ghc-X.Y.Z.a static library; this is the - # rolled up one with all dependencies included. - find ./dist -name "libHS*.a" -exec cp {} $out/_pkg \; - find ${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib -name "*.a" -exec cp {} $out/_pkg \; - find ${pkgs.gmp6.override { withStatic = true; }}/lib -name "*.a" -exec cp {} $out/_pkg \; - # There is no static libc - ${pkgs.tree}/bin/tree $out/_pkg - (cd $out/_pkg; ${pkgs.zip}/bin/zip -r -9 $out/pkg-ios-aarch64-swift-json.zip *) - rm -fR $out/_pkg - mkdir -p $out/nix-support - echo "file binary-dist \"$(echo $out/*.zip)\"" \ - > $out/nix-support/hydra-build-products - ''; + postInstall = iosPostInstall "pkg-ios-aarch64-swift-json"; }; # This is the aarch64-darwin build with tagged JSON format (for Mac & Flutter) "aarch64-darwin:lib:simplex-chat" = (drv pkgs).simplex-chat.components.library.override { @@ -251,24 +252,7 @@ # for iOS we also use -staticlib, to get one rolled up library. # still needs mac2ios patching of the archives. ghcOptions = [ "-staticlib" "-threaded" "-DIOS" ]; - postInstall = '' - ${pkgs.tree}/bin/tree $out - mkdir -p $out/_pkg - # copy over includes, we might want those, but maybe not. - # cp -r $out/lib/*/*/include $out/_pkg/ - # find the libHS...ghc-X.Y.Z.a static library; this is the - # rolled up one with all dependencies included. - find ./dist -name "libHS*.a" -exec cp {} $out/_pkg \; - find ${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib -name "*.a" -exec cp {} $out/_pkg \; - find ${pkgs.gmp6.override { withStatic = true; }}/lib -name "*.a" -exec cp {} $out/_pkg \; - # There is no static libc - ${pkgs.tree}/bin/tree $out/_pkg - (cd $out/_pkg; ${pkgs.zip}/bin/zip -r -9 $out/pkg-ios-aarch64-tagged-json.zip *) - rm -fR $out/_pkg - mkdir -p $out/nix-support - echo "file binary-dist \"$(echo $out/*.zip)\"" \ - > $out/nix-support/hydra-build-products - ''; + postInstall = iosPostInstall "pkg-ios-aarch64-tagged-json"; }; }; "x86_64-darwin" = { @@ -279,24 +263,7 @@ # for iOS we also use -staticlib, to get one rolled up library. # still needs mac2ios patching of the archives. ghcOptions = [ "-staticlib" "-threaded" "-DIOS" ]; - postInstall = '' - ${pkgs.tree}/bin/tree $out - mkdir -p $out/_pkg - # copy over includes, we might want those, but maybe not. - # cp -r $out/lib/*/*/include $out/_pkg/ - # find the libHS...ghc-X.Y.Z.a static library; this is the - # rolled up one with all dependencies included. - find ./dist -name "libHS*.a" -exec cp {} $out/_pkg \; - find ${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib -name "*.a" -exec cp {} $out/_pkg \; - find ${pkgs.gmp6.override { withStatic = true; }}/lib -name "*.a" -exec cp {} $out/_pkg \; - # There is no static libc - ${pkgs.tree}/bin/tree $out/_pkg - (cd $out/_pkg; ${pkgs.zip}/bin/zip -r -9 $out/pkg-ios-x86_64-swift-json.zip *) - rm -fR $out/_pkg - mkdir -p $out/nix-support - echo "file binary-dist \"$(echo $out/*.zip)\"" \ - > $out/nix-support/hydra-build-products - ''; + postInstall = iosPostInstall "pkg-ios-x86_64-swift-json"; }; # This is the aarch64-darwin build with tagged JSON format (for Mac & Flutter) "x86_64-darwin:lib:simplex-chat" = (drv pkgs).simplex-chat.components.library.override { @@ -305,24 +272,7 @@ # for iOS we also use -staticlib, to get one rolled up library. # still needs mac2ios patching of the archives. ghcOptions = [ "-staticlib" "-threaded" "-DIOS" ]; - postInstall = '' - ${pkgs.tree}/bin/tree $out - mkdir -p $out/_pkg - # copy over includes, we might want those, but maybe not. - # cp -r $out/lib/*/*/include $out/_pkg/ - # find the libHS...ghc-X.Y.Z.a static library; this is the - # rolled up one with all dependencies included. - find ./dist -name "libHS*.a" -exec cp {} $out/_pkg \; - find ${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib -name "*.a" -exec cp {} $out/_pkg \; - find ${pkgs.gmp6.override { withStatic = true; }}/lib -name "*.a" -exec cp {} $out/_pkg \; - # There is no static libc - ${pkgs.tree}/bin/tree $out/_pkg - (cd $out/_pkg; ${pkgs.zip}/bin/zip -r -9 $out/pkg-ios-x86_64-tagged-json.zip *) - rm -fR $out/_pkg - mkdir -p $out/nix-support - echo "file binary-dist \"$(echo $out/*.zip)\"" \ - > $out/nix-support/hydra-build-products - ''; + postInstall = iosPostInstall "pkg-ios-x86_64-tagged-json"; }; }; }.${system} or {});