git.iko.soy/typeable/nixpkgs
on master help sign in
libaom: use git stub instead of patching changelog

It probably needs less maintenance.

commit1720abc263384992c10587dc51f8635bfa4e2391 authorJörg Thalheim <joerg@thalheim.io> dateMon 17 Dec 2018, 23:22 (8 years ago) parentcee81d5
1 file changed+15−26
pkgs/development/libraries/libaom/default.nix+15−26
pkgs/development/libraries/libaom/default.nix+15−26
@@ -1,4 +1,4 @@
1−{ stdenv, fetchgit, yasm, perl, cmake, pkgconfig, python3Packages, writeText }:
1+{ stdenv, fetchgit, yasm, perl, cmake, pkgconfig, python3, writeText }:
22
33stdenv.mkDerivation rec {
44 name = "libaom-${version}";
@@ -10,33 +10,22 @@ stdenv.mkDerivation rec {
1010 sha256 = "07h2vhdiq7c3fqaz44rl4vja3dgryi6n7kwbwbj1rh485ski4j82";
1111 };
1212
13− buildInputs = [ perl yasm ];
14− nativeBuildInputs = [ cmake pkgconfig python3Packages.python ];
13+ nativeBuildInputs = [
14+ yasm perl cmake pkgconfig python3
15+ ];
1516
16− cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
17+ cmakeFlags = [
18+ "-DBUILD_SHARED_LIBS=ON"
19+ ];
1720
18− # * libaom tries to detect what version it is
19− # * I couldn't get it to grab this from git info,
20− # (which needs at least leaveDotGit=true)
21− # * it uses a perl script to parse from CHANGELOG,
22− # but 1.0.0 doesn't contain an entry for itself :(
23− # * Upstream patch that adds the entry also nukes all of
24− # the versions before a project change (open-sourcing?)
25− # and as a result is 34K which is way too big just to fix this!
26− # * A stable URL to fetch this from works, but...
27− # * Upon inspection the resulting CHANGELOG is shorter
28− # than this comment, so while yes this is a bit gross
29− # adding these 4 lines here does the job without
30− # a huge patch in spirit of preferring upstream's fix
31− # instead of `sed -i 's/v0\.1\.0/v1.0.0/g' aom.pc` or so.
32− postPatch = let actual_changelog = writeText "CHANGELOG" ''
33− 2018-06-28 v1.0.0
34− AOMedia Codec Workgroup Approved version 1.0
35−
36− 2016-04-07 v0.1.0 "AOMedia Codec 1"
37− This release is the first Alliance for Open Media codec.
38− ''; in ''
39− cp ${actual_changelog} CHANGELOG
21+ preConfigure = ''
22+ # build uses `git describe` to set the build version
23+ cat > $NIX_BUILD_TOP/git << "EOF"
24+ #!${stdenv.shell}
25+ echo v${version}
26+ EOF
27+ chmod +x $NIX_BUILD_TOP/git
28+ export PATH=$NIX_BUILD_TOP:$PATH
4029 '';
4130
4231 meta = with stdenv.lib; {