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.
This commit is contained in:
sternenseemann
2024-09-11 13:40:21 +02:00
parent 14ba90a8e8
commit 4888c3cd8b
3 changed files with 46 additions and 24 deletions
@@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain
@@ -1,33 +1,31 @@
{
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";
}
@@ -0,0 +1,22 @@
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: .