Skip to content

Conversation

@midchildan
Copy link
Contributor

This PR is part of an attempt to package Traffic Server in Nixpkgs.

Comment on lines +281 to +299
<Layout NixOS>
prefix: /opt/trafficserver
exec_prefix: ${prefix}
bindir: ${exec_prefix}/bin
sbindir: ${exec_prefix}/sbin
libdir: ${exec_prefix}/lib
libexecdir: ${exec_prefix}/libexec
infodir: ${prefix}/share/info
mandir: ${prefix}/share/man
sysconfdir: /etc+
datadir: ${prefix}/share+
docdir: ${prefix}/share/doc+
installbuilddir: ${datadir}/build
includedir: ${prefix}/include
localstatedir: /var/lib+
runtimedir: /run+
logdir: /var/log+
cachedir: /var/cache+
</Layout>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About half of these are replaced through configure flags when building with Nix, but I still added them for the sake of consistency.

Comment on lines +207 to +209
if [[ "$INSTALLDIR" = /nix/store* ]]; then
bail "unsupported option: -i is disabled on Nix"
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/nix/store is where packages are installed and is non-writable.

[Unit]
Description=Apache Traffic Server is a fast, scalable and extensible caching proxy server.
After=syslog.target network.target
After=network.target
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export TM_PIDFILE=$(@exp_bindir@/traffic_layout 2>/dev/null | grep RUNTIMEDIR | cut -d: -f2)/manager.lock ; \
/bin/rm $TM_PIDFILE ; \
if [[ $? -ne 0 ]]; then echo "ERROR: Unable to delete PID"; exit 1; fi'
PIDFile=@exp_runtimedir@/manager.lock
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using PIDFile to clean up PID files is slightly more portable, as some distros don't have /bin/rm.

@apache apache deleted a comment from shinrich Apr 12, 2021
@bryancall bryancall added Build work related to build configuration or environment Configuration labels Apr 12, 2021
@bryancall bryancall added this to the 10.0.0 milestone Apr 12, 2021
@randall randall merged commit 19d3af4 into apache:master Apr 13, 2021
@midchildan midchildan deleted the feat/nixos branch April 13, 2021 16:08
@zwoop zwoop modified the milestones: 10.0.0, 9.2.0 Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build work related to build configuration or environment Configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants