From 6852e6ed253c16e4a088297357ada8681f52e72a Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Mon, 10 Sep 2018 17:29:30 +0800 Subject: [PATCH 1/3] init et-book package --- maintainers/maintainer-list.nix | 5 +++++ pkgs/data/fonts/et-book/default.nix | 22 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 29 insertions(+) create mode 100644 pkgs/data/fonts/et-book/default.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index ecec7bbaf7e3..3ed1957650d2 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -1847,6 +1847,11 @@ github = "jerith666"; name = "Matt McHenry"; }; + jethro = { + email = "jethrokuan95@gmail.com"; + github = "jethrokuan"; + name = "Jethro Kuan"; + }; jfb = { email = "james@yamtime.com"; github = "tftio"; diff --git a/pkgs/data/fonts/et-book/default.nix b/pkgs/data/fonts/et-book/default.nix new file mode 100644 index 000000000000..79f2a2e66ca7 --- /dev/null +++ b/pkgs/data/fonts/et-book/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchFromGitHub }: + +fetchFromGitHub rec { + rev = "1.0"; + name = "et-book-${rev}"; + owner = "jethrokuan"; + repo = "et-book"; + sha256 = "1bfb1l8k7fzgk2l8cikiyfn5x9m0fiwrnsbc1483p8w3qp58s5n2"; + + postFetch = '' + tar -xzf $downloadedFile + mkdir -p $out/share/fonts/truetype + cp -t $out/share/fonts/truetype ${name}/*.ttf + ''; + + meta = with stdenv.lib; { + description = "Font for ET Book"; + license = licenses.free; + platforms = platforms.all; + maintainers = with maintainers; [ jethro ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cd7dca53c84c..02a53902f815 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -151,6 +151,8 @@ with pkgs; ebook2cw = callPackage ../applications/misc/ebook2cw { }; + etBook = callPackage ../data/fonts/et-book { }; + fetchbower = callPackage ../build-support/fetchbower { inherit (nodePackages) bower2nix; }; From 162a176d34bf828985d442462732ebe3f7d6e0f3 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Mon, 10 Sep 2018 22:18:12 +0800 Subject: [PATCH 2/3] update to use original repo --- pkgs/data/fonts/et-book/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/data/fonts/et-book/default.nix b/pkgs/data/fonts/et-book/default.nix index 79f2a2e66ca7..cbbc75f32855 100644 --- a/pkgs/data/fonts/et-book/default.nix +++ b/pkgs/data/fonts/et-book/default.nix @@ -1,16 +1,16 @@ { stdenv, fetchFromGitHub }: fetchFromGitHub rec { - rev = "1.0"; - name = "et-book-${rev}"; - owner = "jethrokuan"; + rev = "7e8f02dadcc23ba42b491b39e5bdf16e7b383031"; + name = "et-book-${builtins.substring 0 6 rev}"; + owner = "edwardtufte"; repo = "et-book"; sha256 = "1bfb1l8k7fzgk2l8cikiyfn5x9m0fiwrnsbc1483p8w3qp58s5n2"; postFetch = '' tar -xzf $downloadedFile mkdir -p $out/share/fonts/truetype - cp -t $out/share/fonts/truetype ${name}/*.ttf + cp -t $out/share/fonts/truetype et-book-${rev}/source/4-ttf/*.ttf ''; meta = with stdenv.lib; { From 96b25ee5bd0616b278b7658f8c52db398cbbcb28 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Mon, 10 Sep 2018 22:31:41 +0800 Subject: [PATCH 3/3] fix wrong license --- pkgs/data/fonts/et-book/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/data/fonts/et-book/default.nix b/pkgs/data/fonts/et-book/default.nix index cbbc75f32855..58586ba7db65 100644 --- a/pkgs/data/fonts/et-book/default.nix +++ b/pkgs/data/fonts/et-book/default.nix @@ -14,8 +14,8 @@ fetchFromGitHub rec { ''; meta = with stdenv.lib; { - description = "Font for ET Book"; - license = licenses.free; + description = "The typeface used in Edward Tufte’s books."; + license = licenses.mit; platforms = platforms.all; maintainers = with maintainers; [ jethro ]; };