ostree: enable ed25519 support

This was omitted in the latest update.

Only adds ~400 KB.

It required adding openssl to tests so I tacked on some cleanups.
In particular, the GI_TYPELIB_PATH was already being set in the wrapper
so we can remove it from the module (not sure why Gtk was even there).

Also switched away from using pkgconfig and docbook_xsl aliases
and reordered the expression a bit.

+42 -19
-11
nixos/tests/installed-tests/ostree.nix
··· 3 makeInstalledTest { 4 tested = pkgs.ostree; 5 6 - # TODO: Wrap/patch the tests directly in the package 7 testConfig = { 8 environment.systemPackages = with pkgs; [ 9 - (python3.withPackages (p: with p; [ pyyaml ])) 10 gnupg 11 ostree 12 ]; 13 - 14 - # for GJS tests 15 - environment.variables.GI_TYPELIB_PATH = lib.makeSearchPath "lib/girepository-1.0" (with pkgs; [ 16 - gtk3 17 - pango.out 18 - ostree 19 - gdk-pixbuf 20 - atk 21 - ]); 22 }; 23 }
··· 3 makeInstalledTest { 4 tested = pkgs.ostree; 5 6 testConfig = { 7 environment.systemPackages = with pkgs; [ 8 gnupg 9 ostree 10 ]; 11 }; 12 }
+13 -8
pkgs/tools/misc/ostree/default.nix
··· 2 , fetchurl 3 , fetchpatch 4 , substituteAll 5 - , pkgconfig 6 , gtk-doc 7 , gobject-introspection 8 , gjs ··· 21 , fuse 22 , utillinuxMinimal 23 , libselinux 24 , libarchive 25 , libcap 26 , bzip2 27 , yacc 28 , libxslt 29 - , docbook_xsl 30 , docbook_xml_dtd_42 31 , python3 32 }: 33 ··· 59 (substituteAll { 60 src = ./fix-test-paths.patch; 61 python3 = testPython.interpreter; 62 }) 63 ]; 64 ··· 66 autoconf 67 automake 68 libtool 69 - pkgconfig 70 gtk-doc 71 gobject-introspection 72 which 73 makeWrapper 74 yacc 75 libxslt 76 - docbook_xsl 77 docbook_xml_dtd_42 78 ]; 79 ··· 85 gpgme 86 fuse 87 libselinux 88 libcap 89 libarchive 90 bzip2 ··· 95 testPython 96 gjs 97 ]; 98 - 99 - preConfigure = '' 100 - env NOCONFIGURE=1 ./autogen.sh 101 - ''; 102 103 enableParallelBuilding = true; 104 ··· 106 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" 107 "--with-systemdsystemgeneratordir=${placeholder "out"}/lib/systemd/system-generators" 108 "--enable-installed-tests" 109 ]; 110 111 makeFlags = [ 112 "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/libostree" 113 "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/libostree" 114 ]; 115 116 postFixup = let 117 typelibPath = stdenv.lib.makeSearchPath "/lib/girepository-1.0" [
··· 2 , fetchurl 3 , fetchpatch 4 , substituteAll 5 + , pkg-config 6 , gtk-doc 7 , gobject-introspection 8 , gjs ··· 21 , fuse 22 , utillinuxMinimal 23 , libselinux 24 + , libsodium 25 , libarchive 26 , libcap 27 , bzip2 28 , yacc 29 , libxslt 30 + , docbook-xsl-nons 31 , docbook_xml_dtd_42 32 + , openssl 33 , python3 34 }: 35 ··· 61 (substituteAll { 62 src = ./fix-test-paths.patch; 63 python3 = testPython.interpreter; 64 + openssl = "${openssl}/bin/openssl"; 65 }) 66 ]; 67 ··· 69 autoconf 70 automake 71 libtool 72 + pkg-config 73 gtk-doc 74 gobject-introspection 75 which 76 makeWrapper 77 yacc 78 libxslt 79 + docbook-xsl-nons 80 docbook_xml_dtd_42 81 ]; 82 ··· 88 gpgme 89 fuse 90 libselinux 91 + libsodium 92 libcap 93 libarchive 94 bzip2 ··· 99 testPython 100 gjs 101 ]; 102 103 enableParallelBuilding = true; 104 ··· 106 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" 107 "--with-systemdsystemgeneratordir=${placeholder "out"}/lib/systemd/system-generators" 108 "--enable-installed-tests" 109 + "--with-ed25519-libsodium" 110 ]; 111 112 makeFlags = [ 113 "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/libostree" 114 "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/libostree" 115 ]; 116 + 117 + preConfigure = '' 118 + env NOCONFIGURE=1 ./autogen.sh 119 + ''; 120 121 postFixup = let 122 typelibPath = stdenv.lib.makeSearchPath "/lib/girepository-1.0" [
+29
pkgs/tools/misc/ostree/fix-test-paths.patch
··· 1 diff --git a/tests/test-basic-user-only.sh b/tests/test-basic-user-only.sh 2 index f65094fd..105be893 100755 3 --- a/tests/test-basic-user-only.sh
··· 1 + diff --git a/tests/libtest.sh b/tests/libtest.sh 2 + index ca457fa2..c0a529ff 100755 3 + --- a/tests/libtest.sh 4 + +++ b/tests/libtest.sh 5 + @@ -709,12 +709,12 @@ gen_ed25519_keys () 6 + { 7 + # Generate private key in PEM format 8 + pemfile="$(mktemp -p ${test_tmpdir} ed25519_XXXXXX.pem)" 9 + - openssl genpkey -algorithm ed25519 -outform PEM -out "${pemfile}" 10 + + @openssl@ genpkey -algorithm ed25519 -outform PEM -out "${pemfile}" 11 + 12 + # Based on: http://openssl.6102.n7.nabble.com/ed25519-key-generation-td73907.html 13 + # Extract the private and public parts from generated key. 14 + - ED25519PUBLIC="$(openssl pkey -outform DER -pubout -in ${pemfile} | tail -c 32 | base64)" 15 + - ED25519SEED="$(openssl pkey -outform DER -in ${pemfile} | tail -c 32 | base64)" 16 + + ED25519PUBLIC="$(@openssl@ pkey -outform DER -pubout -in ${pemfile} | tail -c 32 | base64)" 17 + + ED25519SEED="$(@openssl@ pkey -outform DER -in ${pemfile} | tail -c 32 | base64)" 18 + # Secret key is concantination of SEED and PUBLIC 19 + ED25519SECRET="$(echo ${ED25519SEED}${ED25519PUBLIC} | base64 -d | base64 -w 0)" 20 + 21 + @@ -725,7 +725,7 @@ gen_ed25519_keys () 22 + 23 + gen_ed25519_random_public() 24 + { 25 + - openssl genpkey -algorithm ED25519 | openssl pkey -outform DER | tail -c 32 | base64 26 + + @openssl@ genpkey -algorithm ED25519 | @openssl@ pkey -outform DER | tail -c 32 | base64 27 + } 28 + 29 + is_bare_user_only_repo () { 30 diff --git a/tests/test-basic-user-only.sh b/tests/test-basic-user-only.sh 31 index f65094fd..105be893 100755 32 --- a/tests/test-basic-user-only.sh