Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeline: init at 2.4.0 #120453

Merged
merged 3 commits into from May 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
89 changes: 89 additions & 0 deletions pkgs/applications/office/timeline/default.nix
@@ -0,0 +1,89 @@
{ lib
, fetchurl
, python3
, gettext
, makeDesktopItem
, copyDesktopItems
}:

python3.pkgs.buildPythonApplication rec {
pname = "timeline";
version = "2.4.0";

src = fetchurl {
url = "mirror://sourceforge/thetimelineproj/${pname}-${version}.zip";
sha256 = "1pa0whqci6c2p20xf7gbndrrpr1xg42ixhql595ibdd4p3l37v23";
};

nativeBuildInputs = [ python3.pkgs.wrapPython copyDesktopItems ];

pythonPath = with python3.pkgs; [
wxPython_4_0 # not compatible with wxPython_4_1. reported upstream https://github.com/wxWidgets/Phoenix/issues/1956
humblewx
icalendar
markdown
pysvg-py3
pillow
];

checkInputs = [
gettext
python3.pkgs.mock
];

desktopItems = [
(makeDesktopItem {
desktopName = "Timeline";
name = "timeline";
comment = "Display and navigate information on a timeline";
icon = "timeline";
terminal = false;
exec = "timeline";
categories = "Office;Calendar;";
})
];

dontBuild = true;
doCheck = false;
davidak marked this conversation as resolved.
Show resolved Hide resolved

patchPhase = ''
sed -i "s|_ROOT =.*|_ROOT = \"$out/usr/share/timeline/\"|" source/timelinelib/config/paths.py
'';

installPhase = ''
runHook preInstall

site_packages=$out/${python3.pkgs.python.sitePackages}
install -D -m755 source/timeline.py $out/bin/timeline
mkdir -p $site_packages
cp -r source/timelinelib $site_packages/

mkdir -p $out/usr/share/timeline/locale
cp -r icons $out/usr/share/timeline/
cp -r translations/ $out/usr/share/timeline/

mkdir -p $out/share/icons/hicolor/{48x48,32x32,16x16}/apps
cp icons/48.png $out/share/icons/hicolor/48x48/apps/timeline.png
cp icons/32.png $out/share/icons/hicolor/32x32/apps/timeline.png
cp icons/16.png $out/share/icons/hicolor/16x16/apps/timeline.png

runHook postInstall
'';

# tests fail because they need an x server
# Unable to access the X Display, is $DISPLAY set properly?
checkPhase = ''
runHook preCheck
${python3.interpreter} tools/execute-specs.py
runHook postCheck
'';

meta = with lib; {
homepage = "http://thetimelineproj.sourceforge.net/";
changelog = "http://thetimelineproj.sourceforge.net/changelog.html";
description = "Display and navigate information on a timeline";
license = with licenses; [ gpl3Only cc-by-sa-30 ];
platforms = with platforms; unix;
maintainers = with maintainers; [ davidak ];
};
}
42 changes: 42 additions & 0 deletions pkgs/development/python-modules/humblewx/default.nix
@@ -0,0 +1,42 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, wxPython_4_0
, python3
}:

buildPythonPackage rec {
pname = "humblewx";
version = "0.2.2";

src = fetchFromGitHub {
owner = "thetimelineproj";
repo = pname;
rev = version;
sha256 = "0fv8gwlbcj000qq34inbwgxf0xgibs590dsyqnw0mmyb7f1iq210";
};

# timeline is not compatible with wxPython_4_1. reported upstream
propagatedBuildInputs = [ wxPython_4_0 ];

checkPhase = ''
runHook preCheck
for i in examples/*; do
${python3.interpreter} $i
done
runHook postCheck
'';

# Unable to access the X Display, is $DISPLAY set properly?
# would have to use nixos module tests, but it is not worth it
doCheck = false;
davidak marked this conversation as resolved.
Show resolved Hide resolved

pythonImportsCheck = [ "humblewx" ];

meta = {
homepage = "https://github.com/thetimelineproj/humblewx";
description = "Library that simplifies creating user interfaces with wxPython";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ davidak ];
};
}
33 changes: 33 additions & 0 deletions pkgs/development/python-modules/pysvg-py3/default.nix
@@ -0,0 +1,33 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, python
}:

buildPythonPackage rec {
pname = "pysvg-py3";
version = "0.2.2-post3";

src = fetchFromGitHub {
owner = "alorence";
repo = pname;
rev = version;
sha256 = "1slync0knpcjgl4xpym8w4249iy6vmrwbarpnbjzn9xca8g1h2f0";
};

checkPhase = ''
runHook preCheck
mkdir testoutput
${python.interpreter} sample/tutorial.py
runHook postCheck
'';
davidak marked this conversation as resolved.
Show resolved Hide resolved

pythonImportsCheck = [ "pysvg" ];

meta = {
homepage = "https://github.com/alorence/pysvg-py3";
description = "Creating SVG with Python";
license = lib.licenses.bsd2;
maintainers = with lib.maintainers; [ davidak ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -4141,6 +4141,8 @@ in
inherit (darwin.apple_sdk.frameworks) AppKit Security;
};

timeline = callPackage ../applications/office/timeline/default.nix { };

tsm-client = callPackage ../tools/backup/tsm-client { jdk8 = null; };
tsm-client-withGui = callPackage ../tools/backup/tsm-client { };

Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -3115,6 +3115,8 @@ in {

humanize = callPackage ../development/python-modules/humanize { };

humblewx = callPackage ../development/python-modules/humblewx { };

hupper = callPackage ../development/python-modules/hupper { };

hvac = callPackage ../development/python-modules/hvac { };
Expand Down Expand Up @@ -6168,6 +6170,8 @@ in {

py_stringmatching = callPackage ../development/python-modules/py_stringmatching { };

pysvg-py3 = callPackage ../development/python-modules/pysvg-py3 { };

pysvn = callPackage ../development/python-modules/pysvn {
inherit (pkgs) bash subversion apr aprutil expat neon openssl;
};
Expand Down