haskellPackages.ghc-settings-edit: build using Cabal

This allows us to reuse our existing infrastructure which alreday
contains workarounds for various issues. Prior to this,
ghc-settings-edit wouldn't compile with musl for some
reason.

+46 -24
+2
pkgs/development/tools/haskell/ghc-settings-edit/Setup.hs
··· 1 + import Distribution.Simple 2 + main = defaultMain
+22 -24
pkgs/development/tools/haskell/ghc-settings-edit/default.nix
··· 1 1 { 2 - stdenv, 3 - ghc, 2 + mkDerivation, 3 + base, 4 + containers, 4 5 lib, 5 6 }: 6 7 7 - stdenv.mkDerivation { 8 + mkDerivation { 8 9 pname = "ghc-settings-edit"; 9 10 version = "0.1.0"; 10 - # See the source code for an explanation 11 - src = ./ghc-settings-edit.lhs; 12 - dontUnpack = true; 13 - dontBuild = true; 14 - 15 - nativeBuildInputs = [ ghc ]; 16 - installPhase = '' 17 - runHook preInstall 18 - 19 - mkdir -p "$out/bin" 20 - ${ghc.targetPrefix}ghc --make "$src" -o "$out/bin/ghc-settings-edit" 21 - 22 - runHook postInstall 23 - ''; 24 - 25 - meta = { 26 - license = [ 27 - lib.licenses.mit 28 - lib.licenses.bsd3 11 + src = lib.fileset.toSource { 12 + root = ./.; 13 + fileset = lib.fileset.unions [ 14 + ./Setup.hs 15 + ./ghc-settings-edit.lhs 16 + ./ghc-settings-edit.cabal 29 17 ]; 30 - platforms = lib.platforms.all; 31 - description = "Tool for editing GHC's settings file"; 32 18 }; 19 + isLibrary = false; 20 + isExecutable = true; 21 + executableHaskellDepends = [ 22 + base 23 + containers 24 + ]; 25 + license = [ 26 + lib.licenses.mit 27 + lib.licenses.bsd3 28 + ]; 29 + description = "Tool for editing GHC's settings file"; 30 + mainProgram = "ghc-settings-edit"; 33 31 }
+22
pkgs/development/tools/haskell/ghc-settings-edit/ghc-settings-edit.cabal
··· 1 + cabal-version: 2.2 2 + name: ghc-settings-edit 3 + version: 0.1.0 4 + synopsis: Tool for editing GHC's settings file 5 + -- TODO: description for hackage 6 + -- TODO: category for hackage 7 + license: MIT AND BSD-3-Clause 8 + author: sternenseemann 9 + -- FIXME: must be email for potential Hackage upload 10 + maintainer: @NixOS/haskell 11 + copyright: © 2024 The Nixpkgs/NixOS contributors 12 + stability: experimental 13 + build-type: Simple 14 + bug-reports: https://github.com/NixOS/nixpkgs/issues 15 + 16 + executable ghc-settings-edit 17 + default-language: Haskell2010 18 + -- TODO: bounds for hackage 19 + build-depends: base 20 + , containers 21 + main-is: ghc-settings-edit.lhs 22 + hs-source-dirs: .