TMSU icon indicating copy to clipboard operation
TMSU copied to clipboard

Doesn't compile without modification on macOS 10.15.

Open ashleyharvey opened this issue 5 years ago • 8 comments

@oniony the latest build requires me to make modifications to Makefile to compile.

Paths have to change (eg. /usr/bin -> /usr/local/bin) as well as GNU utilities used instead of macOS's BSD by default (e.g. cp -> gcp).

I can submit my modified Makefile, but:

  1. It depends on those extra GNU utilities and,
  2. I'm not sure how you would split releases into Linux and macOS

One advantage is that it brings the project a step closer to releasing through brew, which would be great, but also adds some complexity. Also I'm not sure how to resolve those dependencies although I imagine brew can do that fairly easily, being a package manager and all.

Interested to hear your thoughts on it, and happy to submit my Makefile if you want it.

ashleyharvey avatar Feb 23 '20 22:02 ashleyharvey

I'm not sure. I don't own any Apple devices. Have a look to see if 'make' supports conditionals that would allow different tools for different cases. As to the paths, these are easily overridden on the command line. It could be we could move the name of the command into a variable then that, too, could be overridden.

On Sun, 23 Feb 2020, 22:55 Ashley Harvey, [email protected] wrote:

@oniony https://github.com/oniony the latest build requires me to make modifications to Makefile to compile.

Paths have to change (eg. /usr/bin -> /usr/local/bin) as well as GNU utilities used instead of macOS's BSD by default (e.g. cp -> gcp).

I can submit my modified Makefile, but:

  1. It depends on those extra GNU utilities and,
  2. I'm not sure how you would split releases into Linux and macOS

One advantage is that it brings the project a step closer to releasing through brew, which would be great, but also adds some complexity. Also I'm not sure how to resolve those dependencies although I imagine brew can do that fairly easily, being a package manager and all.

Interested to hear your thoughts on it, and happy to submit my Makefile if you want it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/186?email_source=notifications&email_token=AAABOB36GNB6HH25GQPI3R3REL5FJA5CNFSM4KZ6RFEKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IPTACHQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABOB5XQJ76WZ2ZIUO6NELREL5FJANCNFSM4KZ6RFEA .

oniony avatar Feb 23 '20 23:02 oniony

It's that, or find a way of avoiding use cp's -t flag (which is the cause of the incompatibility between OS X and GNU cp)

jay-to-the-dee avatar Aug 03 '20 00:08 jay-to-the-dee

Here's my modified Makefile:

Makefile.txt

Otherwise tmsu appears to work perfectly on Catalina (including tmsu mount).

jay-to-the-dee avatar Aug 03 '20 21:08 jay-to-the-dee

CMake supports conditionals on OS:

if (APPLE)
    set(OPENSSL_ROOT_DIR ${OPENSSL_ROOT_DIR} /usr/local/opt/[email protected])
    set(OPENSSL_CRYPTO_LIBRARY ${OPENSSL_ROOT_DIR}/lib/libcrypto.dylib CACHE FILEPATH "" FORCE)
    set(OPENSSL_SSL_LIBRARY ${OPENSSL_ROOT_DIR}/lib/libssl.dylib CACHE FILEPATH "" FORCE)
endif()

NightMachinery avatar Aug 11 '20 15:08 NightMachinery

We can also solve the g prefix problem by running a preInstall shell script that checks if we are on Linux, and if so, symlinks the GNU tools to their g-prefixed names. E.g.,

isLinux () {
    [[ "$uname" == "Linux" ]]
}
lnrp () {
    local f="$1" d="$2"
    ln -s "$(realpath "$f")" "$d"
}
if isLinux ; then
	lnrp cp /usr/bin/gcp
	...
fi

NightMachinery avatar Aug 11 '20 15:08 NightMachinery

@oniony Is there a special reason TMSU can't use the standard distribution mechanism of go CLI apps, namely go get -u -v https://github.com/oniony/TMSU? That's cross-platform and nice to use.

NightMachinery avatar Aug 11 '20 16:08 NightMachinery

The tests in tests/runall also need find changed to gfind:

RUNNING INTEGRATION TESTS

find: -perm: /+x: illegal mode string

After that, with @jay-to-the-dee Makefile, all tests pass successfully. I also needed to set my GOPATH correctly, which I hadn't needed to before.

NightMachinery avatar Aug 11 '20 16:08 NightMachinery

You can already do that if you want.

On Tue, 11 Aug 2020, 17:14 NightMachinary, [email protected] wrote:

@oniony https://github.com/oniony Is there a special reason TMSU can't use the standard distribution mechanism of go CLI apps, namely go get -u -v https://github.com/oniony/TMSU? That's cross-platform and nice to use.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/186#issuecomment-672060366, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABOBYLUIHAVO3ZKK7JFALSAFU6HANCNFSM4KZ6RFEA .

oniony avatar Aug 11 '20 17:08 oniony