feat(packages)!: add support for dream2nix

Also convert `sdcv` to use `dream2nix`
This commit is contained in:
reo101 2024-08-02 10:30:48 +03:00
parent 4f891220c1
commit 4e3733178e
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
4 changed files with 206 additions and 84 deletions

View file

@ -1,52 +1,61 @@
{ lib
, stdenv
, darwin
# Fetchers
, fetchFromGitHub
# Build inputs
, cmake
, pkg-config
, iconv
, pcre
, readline
, glib
, zlib
{ config
, lib
, dream2nix
, ...
}:
}: {
imports = [
dream2nix.modules.dream2nix.mkDerivation
];
stdenv.mkDerivation rec {
pname = "sdcv";
deps = { nixpkgs, ... }: {
inherit (nixpkgs)
# Fetchers
fetchFromGitHub
# Build inputs
cmake
pkg-config
iconv
pcre
readline
glib
zlib
;
};
name = "sdcv";
version = "0.5.5";
src = fetchFromGitHub {
owner = "Dushistov";
repo = pname;
rev = "v${version}";
hash = "sha256-EyvljVXhOsdxIYOGTzD+T16nvW7/RNx3DuQ2OdhjXJ4=";
};
mkDerivation = {
src = config.deps.fetchFromGitHub {
owner = "Dushistov";
repo = config.name;
rev = "v${config.version}";
hash = "sha256-EyvljVXhOsdxIYOGTzD+T16nvW7/RNx3DuQ2OdhjXJ4=";
};
nativeBuildInputs = [
pkg-config
cmake
iconv
];
nativeBuildInputs = with config.deps; [
pkg-config
cmake
iconv
];
buildInputs = [
pcre
readline
glib
zlib
];
buildInputs = with config.deps; [
pcre
readline
glib
zlib
];
cmakeFlags = [
# BUG: <https://github.com/Dushistov/sdcv/blob/49c8094b53b7dd90efeabeaf276752a650a0f931/CMakeLists.txt#L58> does not exit
"-DENABLE_NLS=OFF"
];
cmakeFlags = [
# FIXME: <https://github.com/Dushistov/sdcv/blob/49c8094b53b7dd90efeabeaf276752a650a0f931/CMakeLists.txt#L58> does not exit
"-DENABLE_NLS=OFF"
];
meta = with lib; {
description = "Console version of StarDict";
homepage = "https://github.com/Dushistov/sdcv";
license = licenses.gpl2;
# maintainers = with maintainers; [ reo101 ];
meta = with lib; {
description = "Console version of StarDict";
homepage = "https://github.com/Dushistov/sdcv";
license = licenses.gpl2;
maintainers = with maintainers; [ reo101 ];
};
};
}