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

freetype: init demos output #99594

Closed
wants to merge 1 commit into from

Conversation

minijackson
Copy link
Member

Motivation for this change

Add the official freetype2-demos executables that are already packaged in for example Debian and Arch. Discovered them through this very nice article which may be useful if you want to tests those tools.

I haven't tried rebuilding every reverse-dependency of freetype, but poppler builds fine with this patch.

Here is the diffoscope between the "out" output before/after this patch:
--- result-before
+++ result
├── stat {}
│ @@ -1,7 +1,7 @@
│  
│    Size: 59        	Blocks: 0          IO Block: 4096   symbolic link
│  Access: (0777/lrwxrwxrwx)  Uid: ( 1000/minijackson)   Gid: (  100/   users)
│  
│ -Modify: 2020-10-04 20:59:14.711111931 +0000
│ +Modify: 2020-10-04 21:03:19.073979372 +0000
│   --- result-before/lib
├── +++ result/lib
│ │   --- result-before/lib/libfreetype.la
│ ├── +++ result/lib/libfreetype.la
│ │ @@ -34,8 +34,8 @@
│ │  shouldnotlink=no
│ │  
│ │  # Files to dlopen/dlpreopen
│ │  dlopen=''
│ │  dlpreopen=''
│ │  
│ │  # Directory that this library needs to be installed in:
│ │ -libdir='/nix/store/fkhsnzjz23rvw5gpgagy9w53cwd8156s-freetype-2.10.2/lib'
│ │ +libdir='/nix/store/cwkk58291a11nanzmh56mjjswgyazmjb-freetype-2.10.2/lib'

Here is the diffoscope between the "dev" output before/after this patch:
--- result-dev-before
+++ result-dev
├── stat {}
│ @@ -1,7 +1,7 @@
│  
│    Size: 63        	Blocks: 8          IO Block: 4096   symbolic link
│  Access: (0777/lrwxrwxrwx)  Uid: ( 1000/minijackson)   Gid: (  100/   users)
│  
│ -Modify: 2020-10-04 20:59:17.382110340 +0000
│ +Modify: 2020-10-04 21:03:16.711980546 +0000
│   --- result-dev-before/bin
├── +++ result-dev/bin
│ │   --- result-dev-before/bin/.freetype-config-wrapped
│ ├── +++ result-dev/bin/.freetype-config-wrapped
│ │ @@ -31,19 +31,19 @@
│ │  
│ │    version=`pkg-config --modversion freetype2`
│ │  
│ │    cflags=`pkg-config --cflags freetype2`
│ │    dynamic_libs=`pkg-config --libs freetype2`
│ │    static_libs=`pkg-config --static --libs freetype2`
│ │  else
│ │ -  prefix="/nix/store/fkhsnzjz23rvw5gpgagy9w53cwd8156s-freetype-2.10.2"
│ │ -  exec_prefix="/nix/store/fkhsnzjz23rvw5gpgagy9w53cwd8156s-freetype-2.10.2"
│ │ +  prefix="/nix/store/cwkk58291a11nanzmh56mjjswgyazmjb-freetype-2.10.2"
│ │ +  exec_prefix="/nix/store/cwkk58291a11nanzmh56mjjswgyazmjb-freetype-2.10.2"
│ │  
│ │ -  includedir="/nix/store/a33makx5vm3dgcpc98qi3rd6blikla7p-freetype-2.10.2-dev/include"
│ │ -  libdir="/nix/store/fkhsnzjz23rvw5gpgagy9w53cwd8156s-freetype-2.10.2/lib"
│ │ +  includedir="/nix/store/vjja46iqckd2hqkqid2bid4vl8g6yl61-freetype-2.10.2-dev/include"
│ │ +  libdir="/nix/store/cwkk58291a11nanzmh56mjjswgyazmjb-freetype-2.10.2/lib"
│ │  
│ │    version=23.2.17
│ │  
│ │    cflags="-I${SYSROOT}$includedir/freetype2"
│ │    dynamic_libs="-lfreetype"
│ │    static_libs="-lfreetype -L/nix/store/9sfmwj09ij65qnc8dgv8h56gf12b60nn-zlib-1.2.11/lib -lz -L/nix/store/z0sf96nxxw6qdl5yf1vl0sn07cnh1fqd-bzip2-1.0.6.0.1/lib -lbz2 -L/nix/store/9sfmwj09ij65qnc8dgv8h56gf12b60nn-zlib-1.2.11/lib -L/nix/store/4wxw447p6ydk30gwrggz9kyh5xfgaxl9-libpng-apng-1.6.37/lib -lpng16 -lm -lz -lm -lz"
│ │    if test "${SYSROOT}$libdir" != "/usr/lib"   &&
│ │   --- result-dev-before/bin/freetype-config
│ ├── +++ result-dev/bin/freetype-config
│ │ @@ -1,3 +1,3 @@
│ │  #! /nix/store/2jysm3dfsgby5sw5jgj43qjrb5v79ms9-bash-4.4-p23/bin/bash -e
│ │ -export PKG_CONFIG_PATH='/nix/store/yc2npbij60jxn3fvdys5pyvnjb1wasa6-zlib-1.2.11-dev/lib/pkgconfig:/nix/store/iyy0j8c1njdb0aic3dqcbbhkqv4gwpxa-bzip2-1.0.6.0.1-dev/lib/pkgconfig:/nix/store/jsn2hx31hzq5d625m6479xvsl8f9jggv-libpng-apng-1.6.37-dev/lib/pkgconfig:/nix/store/yc2npbij60jxn3fvdys5pyvnjb1wasa6-zlib-1.2.11-dev/lib/pkgconfig:/nix/store/iyy0j8c1njdb0aic3dqcbbhkqv4gwpxa-bzip2-1.0.6.0.1-dev/lib/pkgconfig:/nix/store/jsn2hx31hzq5d625m6479xvsl8f9jggv-libpng-apng-1.6.37-dev/lib/pkgconfig:/nix/store/a33makx5vm3dgcpc98qi3rd6blikla7p-freetype-2.10.2-dev/lib/pkgconfig'
│ │ -exec -a "$0" "/nix/store/a33makx5vm3dgcpc98qi3rd6blikla7p-freetype-2.10.2-dev/bin/.freetype-config-wrapped"  "$@"
│ │ +export PKG_CONFIG_PATH='/nix/store/yc2npbij60jxn3fvdys5pyvnjb1wasa6-zlib-1.2.11-dev/lib/pkgconfig:/nix/store/iyy0j8c1njdb0aic3dqcbbhkqv4gwpxa-bzip2-1.0.6.0.1-dev/lib/pkgconfig:/nix/store/jsn2hx31hzq5d625m6479xvsl8f9jggv-libpng-apng-1.6.37-dev/lib/pkgconfig:/nix/store/ciazf7whrg6pxly22kx0izy755pjll83-libX11-1.6.8-dev/lib/pkgconfig:/nix/store/mxvpxymvhxizkpzxmr6qfvikhmy7wv3n-xorgproto-2019.1/share/pkgconfig:/nix/store/v1v5ch5zf9r9x3hgw0s6ad7i7iiwm8g2-libxcb-1.13.1-dev/lib/pkgconfig:/nix/store/yc2npbij60jxn3fvdys5pyvnjb1wasa6-zlib-1.2.11-dev/lib/pkgconfig:/nix/store/iyy0j8c1njdb0aic3dqcbbhkqv4gwpxa-bzip2-1.0.6.0.1-dev/lib/pkgconfig:/nix/store/jsn2hx31hzq5d625m6479xvsl8f9jggv-libpng-apng-1.6.37-dev/lib/pkgconfig:/nix/store/ciazf7whrg6pxly22kx0izy755pjll83-libX11-1.6.8-dev/lib/pkgconfig:/nix/store/mxvpxymvhxizkpzxmr6qfvikhmy7wv3n-xorgproto-2019.1/share/pkgconfig:/nix/store/v1v5ch5zf9r9x3hgw0s6ad7i7iiwm8g2-libxcb-1.13.1-dev/lib/pkgconfig:/nix/store/vjja46iqckd2hqkqid2bid4vl8g6yl61-freetype-2.10.2-dev/lib/pkgconfig'
│ │ +exec -a "$0" "/nix/store/vjja46iqckd2hqkqid2bid4vl8g6yl61-freetype-2.10.2-dev/bin/.freetype-config-wrapped"  "$@"
│ │ ├── stat {}
│ │ │ @@ -1,7 +1,7 @@
│ │ │  
│ │ │ -  Size: 755       	Blocks: 8          IO Block: 4096   regular file
│ │ │ +  Size: 1211      	Blocks: 8          IO Block: 4096   regular file
│ │ │  Access: (0555/-r-xr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
│ │ │  
│ │ │  Modify: 1970-01-01 00:00:01.000000000 +0000
│   --- result-dev-before/lib
├── +++ result-dev/lib
│ │   --- result-dev-before/lib/pkgconfig
│ ├── +++ result-dev/lib/pkgconfig
│ │ │   --- result-dev-before/lib/pkgconfig/freetype2.pc
│ │ ├── +++ result-dev/lib/pkgconfig/freetype2.pc
│ │ │ @@ -1,11 +1,11 @@
│ │ │ -prefix=/nix/store/fkhsnzjz23rvw5gpgagy9w53cwd8156s-freetype-2.10.2
│ │ │ -exec_prefix=/nix/store/fkhsnzjz23rvw5gpgagy9w53cwd8156s-freetype-2.10.2
│ │ │ -libdir=/nix/store/fkhsnzjz23rvw5gpgagy9w53cwd8156s-freetype-2.10.2/lib
│ │ │ -includedir=/nix/store/a33makx5vm3dgcpc98qi3rd6blikla7p-freetype-2.10.2-dev/include
│ │ │ +prefix=/nix/store/cwkk58291a11nanzmh56mjjswgyazmjb-freetype-2.10.2
│ │ │ +exec_prefix=/nix/store/cwkk58291a11nanzmh56mjjswgyazmjb-freetype-2.10.2
│ │ │ +libdir=/nix/store/cwkk58291a11nanzmh56mjjswgyazmjb-freetype-2.10.2/lib
│ │ │ +includedir=/nix/store/vjja46iqckd2hqkqid2bid4vl8g6yl61-freetype-2.10.2-dev/include
│ │ │  
│ │ │  Name: FreeType 2
│ │ │  URL: https://freetype.org
│ │ │  Description: A free, high-quality, and portable font engine.
│ │ │  Version: 23.2.17
│ │ │  Requires:
│ │ │  Requires.private: zlib, bzip2, libpng
│   --- result-dev-before/nix-support
├── +++ result-dev/nix-support
│ │   --- result-dev-before/nix-support/propagated-build-inputs
│ ├── +++ result-dev/nix-support/propagated-build-inputs
│ │ @@ -1 +1 @@
│ │ -/nix/store/yc2npbij60jxn3fvdys5pyvnjb1wasa6-zlib-1.2.11-dev /nix/store/iyy0j8c1njdb0aic3dqcbbhkqv4gwpxa-bzip2-1.0.6.0.1-dev /nix/store/jsn2hx31hzq5d625m6479xvsl8f9jggv-libpng-apng-1.6.37-dev  /nix/store/fkhsnzjz23rvw5gpgagy9w53cwd8156s-freetype-2.10.2
│ │ +/nix/store/yc2npbij60jxn3fvdys5pyvnjb1wasa6-zlib-1.2.11-dev /nix/store/iyy0j8c1njdb0aic3dqcbbhkqv4gwpxa-bzip2-1.0.6.0.1-dev /nix/store/jsn2hx31hzq5d625m6479xvsl8f9jggv-libpng-apng-1.6.37-dev /nix/store/ciazf7whrg6pxly22kx0izy755pjll83-libX11-1.6.8-dev  /nix/store/cwkk58291a11nanzmh56mjjswgyazmjb-freetype-2.10.2
│ │ ├── stat {}
│ │ │ @@ -1,7 +1,7 @@
│ │ │  
│ │ │ -  Size: 251       	Blocks: 8          IO Block: 4096   regular file
│ │ │ +  Size: 312       	Blocks: 8          IO Block: 4096   regular file
│ │ │  Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
│ │ │  
│ │ │  Modify: 1970-01-01 00:00:01.000000000 +0000

As shown by the second diffoscope output, this adds a dependency on libX11 for the "dev" package, which I would like to avoid but I'm not sure how to go about that. Any ideas?

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@worldofpeace
Copy link
Contributor

As shown by the second diffoscope output, this adds a dependency on libX11 for the "dev" package, which I would like to avoid but I'm not sure how to go about that. Any ideas?

I believe the only option is to not add x11 to the propagated build inputs. So you have to have the demos in their own package and not as an extra output.

@minijackson
Copy link
Member Author

I've just tried it, but unfortunately it doesn't seem to work completely: it disappeared fro the propagated build inputs, but is still in the freetype-config. I'll do some more digging

@stale
Copy link

stale bot commented Jul 19, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 19, 2021
@minijackson
Copy link
Member Author

Lost interest in this. If anyone is interested, feel free to pick this work back up.

@minijackson minijackson deleted the init-freetype-demos branch September 14, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants