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.

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