diff --git a/pkgs/by-name/as/asn1c/package.nix b/pkgs/by-name/as/asn1c/package.nix index 1072090c2112..9f07efcb9169 100644 --- a/pkgs/by-name/as/asn1c/package.nix +++ b/pkgs/by-name/as/asn1c/package.nix @@ -1,39 +1,64 @@ { lib, stdenv, - fetchurl, + autoreconfHook, + versionCheckHook, + fetchFromGitHub, perl, + nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "asn1c"; - version = "0.9.28"; + version = "0.9.29"; - src = fetchurl { - url = "https://lionet.info/soft/asn1c-${finalAttrs.version}.tar.gz"; - hash = "sha256-gAdEC2R+8t2ftz2THDOsEXZOavskN9vmOLtOX8gjhrk="; + src = fetchFromGitHub { + owner = "vlm"; + repo = "asn1c"; + tag = "v${finalAttrs.version}"; + hash = "sha256-ms4+tzlVdV0pVGhdBod8sepjHGS4OVxJb3HdrFKv9Cc="; }; outputs = [ "out" "doc" "man" + + # for the one perl utility + "crfc2asn1" + ]; + + postPatch = '' + patchShebangs examples/crfc2asn1.pl + ''; + + nativeBuildInputs = [ + autoreconfHook + versionCheckHook ]; buildInputs = [ perl ]; - preConfigure = '' - patchShebangs examples/crfc2asn1.pl - ''; + enableParallelBuilding = true; postInstall = '' cp -r skeletons/standard-modules $out/share/asn1c ''; - doCheck = true; + # Barely anyone uses this, so make it a split-output + # so we don't carry the dependency on perl into bin. + postFixup = '' + mkdir -p $crfc2asn1/bin + mv $out/bin/crfc2asn1.pl $crfc2asn1/bin/crfc2asn1 + ''; + + doInstallCheck = true; + + passthru.updateScript = nix-update-script { }; meta = { - homepage = "http://lionet.info/asn1c/compiler.html"; + mainProgram = "asn1c"; + homepage = "https://lionet.info/asn1c/compiler.html"; description = "Open Source ASN.1 Compiler"; license = lib.licenses.bsd2; platforms = lib.platforms.unix;