]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - library-bundler
netradiant: strip 16-bit png to 8-bit, fix #153
[xonotic/netradiant.git] / library-bundler
index 756ebf89a25b6869e127ee86c286046c796c89d7..e9a7ccddf12d1eef487ed2cb93015a2ea0eb7310 100755 (executable)
@@ -39,7 +39,7 @@ Common::getPath () {
                if [ "${file_path}" = '-' ]
                then
                        tr '\n' '\0' \
-                       | xargs -0 -n1 -P1 -I{} \
+                       | xargs -0 -P1 -I{} \
                                cygpath --unix '{}'
                else
                        cygpath --unix "${file_path}"
@@ -103,6 +103,11 @@ Multi::excludeLdd () {
                                        | egrep -q '/libatk|/libgdk|/libgtk|/libgio|/libglib|/libgmodule|/libgobject|/libcairo|/libpango|/libfontconfig|/libfreetype'
                                then
                                        Common::noOp
+                               # FreeBSD specific
+                               elif echo "${ldd_line}" \
+                                       | egrep -q '/libc\+\+|/libgxxrt'
+                               then
+                                       Common::noOp
                                else
                                        echo "${ldd_line}"
                                fi
@@ -171,17 +176,17 @@ Multi::getRootPrefix () {
        local lib_file="${1}"
 
        case "${system_name}" in
-               'linux'|'freebsd')
-                       echo "${lib_file}" \
-                       | cut -f2 -d'/'
+               'linux')
+                       echo 'usr'
+                       ;;
+               'freebsd'|'macos')
+                       echo 'usr/local'
                        ;;
                'windows')
                        basename "${lib_file}" \
                        | xargs -n1 -P1 which \
                        | cut -f2 -d'/'
                        ;;
-               'macos')
-                       echo 'usr/local'
        esac
 }
 
@@ -328,6 +333,9 @@ Multi::bundleLibFromFile () {
 }
 
 Multi::cleanUp () {
+       # Remove from bundle things that useless to be distributed,
+       # like headers or static libraries, also remove
+       # empty directories.
        find "${bundle_dir}/lib" \
                -type f \
                -name '*.a' \
@@ -341,8 +349,8 @@ Multi::cleanUp () {
        find "${bundle_dir}/lib" \
                -depth \
                -type d \
-               -exec rmdir {} \; \
-       || true
+               -empty \
+               -exec rmdir {} \;
 }
 
 Linux::getRpath () {
@@ -440,7 +448,7 @@ Windows::listLibForManifest () {
                -name '*.dll' \
                -exec basename {} \; \
        | tr '\n' '\0' \
-       | xargs -0 -n1 -P1 -I{} \
+       | xargs -0 -P1 -I{} \
                printf '  <file name="{}"/>\n'
 }