[137819] trunk/dports/gnome

Ryan Schmidt ryandesign at macports.org
Sun Jun 21 08:12:55 PDT 2015


> On Jun 20, 2015, at 2:26 PM, mk at macports.org wrote:
> 
> Revision
> 137819
> Author
> mk at macports.org
> Date
> 2015-06-20 12:26:29 -0700 (Sat, 20 Jun 2015)
> Log Message
> 
> oxygen-gtk[23]: new (sub)port(s) bringing KDE's oxygen theme to Gtk, thanks to René (closes #43971)

> Added: trunk/dports/gnome/oxygen-gtk2/Portfile (0 => 137819)


> +post-configure {
> +    # Default libraries extension is ".dylib" on Darwin, not ".so", but gtk-engines must have a .so extension
> +    # NB: replacing the extension post-destroot seems to work too, but this seems cleaner to me even if more complicated.
> +    if {[variant_isset universal]} {
> +        reinplace {s/liboxygen-gtk\.dylib/liboxygen-gtk\.so/} ${workpath}/build-x86_64/src/CMakeFiles/oxygen-gtk.dir/build.make \
> +            ${workpath}/build-x86_64/src/CMakeFiles/oxygen-gtk.dir/cmake_clean.cmake \
> +            ${workpath}/build-x86_64/src/CMakeFiles/oxygen-gtk.dir/link.txt \
> +            ${workpath}/build-x86_64/src/cmake_install.cmake
> +        reinplace {s/liboxygen-gtk\.dylib/liboxygen-gtk\.so/} ${workpath}/build-i386/src/CMakeFiles/oxygen-gtk.dir/build.make \
> +            ${workpath}/build-i386/src/CMakeFiles/oxygen-gtk.dir/cmake_clean.cmake \
> +            ${workpath}/build-i386/src/CMakeFiles/oxygen-gtk.dir/link.txt \
> +            ${workpath}/build-i386/src/cmake_install.cmake
> +    } else {
> +        reinplace {s/liboxygen-gtk\.dylib/liboxygen-gtk\.so/} ${workpath}/build/src/CMakeFiles/oxygen-gtk.dir/build.make \
> +            ${workpath}/build/src/CMakeFiles/oxygen-gtk.dir/cmake_clean.cmake \
> +            ${workpath}/build/src/CMakeFiles/oxygen-gtk.dir/link.txt \
> +            ${workpath}/build/src/cmake_install.cmake
> +    }
> +}

In this post-configure block, you're making an assumption about the value of configure.universal_archs; you should use that variable instead, looping over its values. Also, you're repeating some code (the reinplace) 3 times; you should be able to refactor this code to avoid the duplication.

Also, this sounds like a problem upstream should fix. Have they already been informed of the problem? The URL of the bug report should be added as a comment in the portfile, so that we can keep track of when the reinplaces can be removed.



More information about the macports-dev mailing list