deepin-pw-check: init at 5.1.17

This commit is contained in:
rewine 2023-01-12 13:26:32 +08:00 committed by rewine
parent c700cb7b5e
commit dc0b701631
No known key found for this signature in database
GPG Key ID: AABB329787290824
3 changed files with 160 additions and 0 deletions

View File

@ -38,6 +38,7 @@ let
go-lib = callPackage ./go-package/go-lib { inherit replaceAll; };
go-gir-generator = callPackage ./go-package/go-gir-generator { };
go-dbus-factory = callPackage ./go-package/go-dbus-factory { };
deepin-pw-check = callPackage ./go-package/deepin-pw-check { };
#### TOOLS
deepin-gettext-tools = callPackage ./tools/deepin-gettext-tools { };

View File

@ -0,0 +1,84 @@
{ stdenv
, lib
, fetchFromGitHub
, buildGoPackage
, pkg-config
, deepin-gettext-tools
, go-dbus-factory
, go-gir-generator
, go-lib
, gtk3
, glib
, libxcrypt
, gettext
, iniparser
, cracklib
, linux-pam
}:
buildGoPackage rec {
pname = "deepin-pw-check";
version = "5.1.18";
goPackagePath = "github.com/linuxdeepin/deepin-pw-check";
src = fetchFromGitHub {
owner = "linuxdeepin";
repo = pname;
rev = version;
sha256 = "sha256-v1Z4ArkrejjOCO1vD+BhfEl9pTfuvKgLM6Ont0IUCQk=";
};
goDeps = ./deps.nix;
nativeBuildInputs = [
pkg-config
gettext
deepin-gettext-tools
];
buildInputs = [
go-dbus-factory
go-gir-generator
go-lib
glib
libxcrypt
gtk3
iniparser
cracklib
linux-pam
];
postPatch = ''
sed -i 's|iniparser/||' */*.c
substituteInPlace misc/pkgconfig/libdeepin_pw_check.pc \
--replace "/usr" "$out"
substituteInPlace misc/system-services/com.deepin.daemon.PasswdConf.service \
--replace "/usr/lib/deepin-pw-check/deepin-pw-check" "$out/lib/deepin-pw-check/deepin-pw-check"
'';
buildPhase = ''
runHook preBuild
GOPATH="$GOPATH:${go-dbus-factory}/share/gocode"
GOPATH="$GOPATH:${go-gir-generator}/share/gocode"
GOPATH="$GOPATH:${go-lib}/share/gocode"
make -C go/src/${goPackagePath}
runHook postBuild
'';
installPhase = ''
runHook preInstall
make install PREFIX="$out" PKG_FILE_DIR=$out/lib/pkg-config PAM_MODULE_DIR=$out/etc/pam.d -C go/src/${goPackagePath}
# https://github.com/linuxdeepin/deepin-pw-check/blob/d5597482678a489077a506a87f06d2b6c4e7e4ed/debian/rules#L21
ln -s $out/lib/libdeepin_pw_check.so $out/lib/libdeepin_pw_check.so.1
runHook postInstall
'';
meta = with lib; {
description = "Tool to verify the validity of the password";
homepage = "https://github.com/linuxdeepin/deepin-pw-check";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = teams.deepin.members;
};
}

View File

@ -0,0 +1,75 @@
[
{
goPackagePath = "github.com/fsnotify/fsnotify";
fetch = {
type = "git";
url = "https://github.com/fsnotify/fsnotify";
rev = "v1.5.1";
sha256 = "sha256-B8kZ8yiWgallT7R2j1kSRJcJkSGFVf9ise+TpXa+7XY=";
};
}
{
goPackagePath = "github.com/godbus/dbus";
fetch = {
type = "git";
url = "https://github.com/godbus/dbus";
rev = "v5.1.0";
sha256 = "sha256-JSPtmkGEStBEVrKGszeLCb7P38SzQKgMiDC3eDppXs0=";
};
}
{
goPackagePath = "github.com/stretchr/testify";
fetch = {
type = "git";
url = "https://github.com/stretchr/testify";
rev = "v1.7.1";
sha256 = "sha256-disUVIHiIDSj/go3APtJH8awSl8QwKRRFLKI7LRnl0w=";
};
}
{
goPackagePath = "golang.org/x/sys";
fetch = {
type = "git";
url = "https://github.com/golang/sys";
rev = "289d7a0edf712062d9f1484b07bdf2383f48802f";
sha256 = "sha256-AzS/J3OocI7mA0xsIfQzyskNKVija7F2yvuts+EFJBs=";
};
}
{
goPackagePath = "gopkg.in/yaml.v3";
fetch = {
type = "git";
url = "https://github.com/go-yaml/yaml";
rev = "496545a6307b2a7d7a710fd516e5e16e8ab62dbc";
sha256 = "sha256-j8yDji+vqsitpRZirpb4w/Em8nstgf28wpwkcrOlxBk=";
};
}
{
goPackagePath = "github.com/davecgh/go-spew";
fetch = {
type = "git";
url = "https://github.com/davecgh/go-spew";
rev = "v1.1.1";
sha256 = "sha256-nhzSUrE1fCkN0+RL04N4h8jWmRFPPPWbCuDc7Ss0akI=";
};
}
{
goPackagePath = "github.com/stretchr/objx";
fetch = {
type = "git";
url = "https://github.com/stretchr/objx";
rev = "v0.3.0";
sha256 = "sha256-T753/EiD5Cpk6H2JFhd+s1gFvpNptG2XlEHxZF6dQaw=";
};
}
{
goPackagePath = "github.com/pmezard/go-difflib";
fetch = {
type = "git";
url = "https://github.com/pmezard/go-difflib";
rev = "5d4384ee4fb2527b0a1256a821ebfc92f91efefc";
sha256 = "sha256-XA4Oj1gdmdV/F/+8kMI+DBxKPthZ768hbKsO3d9Gx90=";
};
}
]