diff options
| author | Robert Hensing <roberth@users.noreply.github.com> | 2023-11-02 16:57:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-02 16:57:14 +0100 |
| commit | e58bd9237566250d7fa79f91bedde1885621d9e4 (patch) | |
| tree | 5d0e2f682cba920fcb681edaa8160d0143b45e67 | |
| parent | Merge pull request #264676 from Ma27/backport-nextcloud (diff) | |
| parent | haskellPackages.changelog-d: Add basic test (diff) | |
| download | nixpkgs-e58bd9237566250d7fa79f91bedde1885621d9e4.tar.gz | |
Merge pull request #264688 from NixOS/backport-264623-to-release-23.05
[Backport release-23.05] haskellPackages.changelog-d: init
3 files changed, 84 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/non-hackage-packages.nix b/pkgs/development/haskell-modules/non-hackage-packages.nix index beb81a58d863..f5831ed3c7ab 100644 --- a/pkgs/development/haskell-modules/non-hackage-packages.nix +++ b/pkgs/development/haskell-modules/non-hackage-packages.nix @@ -7,6 +7,8 @@ # files. self: super: { + changelog-d = self.callPackage ../misc/haskell/changelog-d {}; + dconf2nix = self.callPackage ../tools/haskell/dconf2nix/dconf2nix.nix { }; ldgallery-compiler = self.callPackage ../../tools/graphics/ldgallery/compiler { }; @@ -38,4 +40,5 @@ self: super: { # Unofficial fork until PRs are merged https://github.com/pcapriotti/optparse-applicative/pulls/roberth # cabal2nix --maintainer roberth https://github.com/hercules-ci/optparse-applicative.git > pkgs/development/misc/haskell/hercules-ci-optparse-applicative.nix hercules-ci-optparse-applicative = self.callPackage ../misc/haskell/hercules-ci-optparse-applicative.nix {}; + } diff --git a/pkgs/development/misc/haskell/changelog-d/changelog-d.nix b/pkgs/development/misc/haskell/changelog-d/changelog-d.nix new file mode 100644 index 000000000000..7abc707540ce --- /dev/null +++ b/pkgs/development/misc/haskell/changelog-d/changelog-d.nix @@ -0,0 +1,30 @@ +{ mkDerivation, base, bytestring, cabal-install-parsers +, Cabal-syntax, containers, directory, fetchgit, filepath +, generic-lens-lite, lib, mtl, optparse-applicative, parsec, pretty +, regex-applicative +}: +mkDerivation { + pname = "changelog-d"; + version = "0.1"; + src = fetchgit { + url = "https://codeberg.org/fgaz/changelog-d"; + sha256 = "0r0gr3bl88am9jivic3i8lfi9l5v1dj7xx4fvw6hhy3wdx7z50z7"; + rev = "2816ddb78cec8b7fa4462c25028437ebfe3ad314"; + fetchSubmodules = true; + }; + isLibrary = false; + isExecutable = true; + libraryHaskellDepends = [ + base bytestring cabal-install-parsers Cabal-syntax containers + directory filepath generic-lens-lite mtl parsec pretty + regex-applicative + ]; + executableHaskellDepends = [ + base bytestring Cabal-syntax directory filepath + optparse-applicative + ]; + doHaddock = false; + description = "Concatenate changelog entries into a single one"; + license = lib.licenses.gpl3Plus; + mainProgram = "changelog-d"; +} diff --git a/pkgs/development/misc/haskell/changelog-d/default.nix b/pkgs/development/misc/haskell/changelog-d/default.nix new file mode 100644 index 000000000000..e4ba565808cf --- /dev/null +++ b/pkgs/development/misc/haskell/changelog-d/default.nix @@ -0,0 +1,51 @@ +{ callPackage +, lib +, pkgs +}: + +(callPackage ./changelog-d.nix { }).overrideAttrs (finalAttrs: oldAttrs: { + + version = oldAttrs.version + "-git-${lib.strings.substring 0 7 oldAttrs.src.rev}"; + + passthru.updateScript = lib.getExe (pkgs.writeShellApplication { + name = "update-changelog-d"; + runtimeInputs = [ + pkgs.cabal2nix + ]; + text = '' + cd pkgs/development/misc/haskell/changelog-d + cabal2nix https://codeberg.org/fgaz/changelog-d >changelog-d.nix + ''; + }); + passthru.tests = { + basic = pkgs.runCommand "changelog-d-basic-test" { + nativeBuildInputs = [ finalAttrs.finalPackage ]; + } '' + mkdir changelogs + cat > changelogs/config <<EOF + organization: NixOS + repository: boondoggle + EOF + cat > changelogs/a <<EOF + synopsis: Support numbers with incrementing base-10 digits + issues: #1234 + description: { + This didn't work before. + } + EOF + changelog-d changelogs >$out + cat -n $out + echo Checking the generated output + set -x + grep -F 'Support numbers with incrementing base-10 digits' $out >/dev/null + grep -F 'https://github.com/NixOS/boondoggle/issues/1234' $out >/dev/null + set +x + ''; + }; + + meta = oldAttrs.meta // { + homepage = "https://codeberg.org/fgaz/changelog-d"; + maintainers = [ lib.maintainers.roberth ]; + }; + +}) |
