Index: Portfile
===================================================================
--- Portfile	(revision 151657)
+++ Portfile	(working copy)
@@ -1,73 +1,66 @@
-PortSystem 1.0
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
 
-name                NicePlayer
-version             0.95
-revision            1
+PortSystem          1.0
+PortGroup           github 1.0
+PortGroup           xcode 1.0
+
+github.setup        jbtule NicePlayer 0.98
 categories          aqua multimedia
-platforms           macosx
-maintainers         nomaintainer
-homepage            http://niceplayer.sourceforge.net
-description         Multi-engine Fullscreen Video Player
-long_description    This program aims to be a Video player designed for \
-                    playing movies nicely for a person who likes to watch or \
-                    present movies on their computer (such as the casual \
-                    viewer or the video artist). This program features full \
-                    screen or border-less floating windows, convenient \
-                    controls for scrubbing or queuing movies, and on the \
-                    fly playlist creation.
+maintainers         {ryandesign @ryandesign} openmaintainer
+license             {MPL-1.1 GPL-2+ LGPL-2.1+}
 
-master_sites        sourceforge:niceplayer
-distname            ${name}_source_${version}
-checksums           sha1 3f59c9c501eb94223e972df26758a55bbe8ea26d
-use_bzip2           yes
-extract.suffix      .tbz2
+description         fullscreen, borderless multi-engine player
 
+long_description    This program aims to be a multi-engine player player \
+                    designed for playing movies nicely for a person who likes \
+                    to watch or present movies on their computer (such as the \
+                    casual viewer or the video artist). This program features \
+                    full screen or border-less floating windows, convenient \
+                    controls for scrubbing or queuing movies, and on-the-fly \
+                    playlist creation.
+
+# Building for i386 fails.
+# https://github.com/jbtule/NicePlayer/issues/8
+supported_archs     x86_64
+
+# Uses submodules and does not offer a full source code download.
+# https://github.com/jbtule/NicePlayer/issues/6
+fetch.type          git
+post-fetch {
+    system -W ${worksrcpath} "git submodule update --init"
+}
+
+patchfiles-append   sdp.patch
+
+# Uses Sparkle and doesn't offer a way to fully disable it.
+# https://github.com/jbtule/NicePlayer/issues/4
+depends_lib-append  path:lib/libssl.dylib:openssl
+patchfiles-append   no-sparkle.patch
 post-patch {
-                    # Remove subversion version extraction while build.
-                    # Needs to be updated with every release of the port or
-                    # the automatic updater will not work!
-                    # The number stored here is the subversion revision.
-                    reinplace "s|REV=.*|REV=514|g" \
-                      ${worksrcpath}/niceplayer/Versioning/version.sh
+    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Libraries/sparkle/Sparkle.xcodeproj/project.pbxproj
 }
 
-use_configure       no
-build.type          pbx
-build.dir           ${workpath}/${name}_source_${version}/niceplayer
-build.target        -configuration Release
-build.args          build -project ${name}.xcodeproj SYMROOT=${workpath}/build
+xcode.configuration Release
 
-pre-destroot {
-  # Rename the following files because of a bug in macports which fails to
-  # uninstall files containg { or }; Ticket #12420
-  set scripts "${workpath}/build/Release/${name}.app/Contents/Resources/Default Scripts"
-  
-  file rename "${scripts}/01 Stretch Aspect Ratio/01 To 16-9 {^*L}.scpt" \
-    "${scripts}/01 Stretch Aspect Ratio/01 To 16-9  ⁅^*L⁆.scpt"
-  file rename "${scripts}/01 Stretch Aspect Ratio/01 To 4-3 {^*K}.scpt" \
-    "${scripts}/01 Stretch Aspect Ratio/01 To 4-3 ⁅^*K⁆.scpt"
-  
-  file rename "${scripts}/02 Time Control/Go To Time...{^*G}.scpt" \
-    "${scripts}/02 Time Control/Go To Time...⁅^*G⁆.scpt"
-  file rename "${scripts}/02 Time Control/Title Sequence (Approx) Jump {^*J}.scpt" \
-    "${scripts}/02 Time Control/Title Sequence (Approx) Jump⁅^*J⁆.scpt"
-  
-  file rename "${scripts}/98 Just For Fun/Send to Background {^*B}.scpt" \
-    "${scripts}/02 Time Control/Send to Background ⁅^*B⁆.scpt"
-  file rename "${scripts}/98 Just For Fun/Set Current Window Transparency {^*T}.scpt" \
-    "${scripts}/02 Time Control/Set Current Window Transparency ⁅^*T⁆.scpt"
+# Do not set INSTALL_PATH as this breaks the app's ability to link to the embedded frameworks.
+xcode.destroot.type
+
+# Uses QuickTime.h which Apple removed in the macOS 10.12 SDK.
+# https://github.com/jbtule/NicePlayer/issues/5
+if {[vercmp ${configure.sdk_version} 10.11] > 0} {
+    configure.sdk_version 10.11
+    # Needs my MacOSX.sdk port and support for it in MacPorts base.
+    if no {
+        configure.sdkroot ${prefix}/Developer/SDKs/MacOSX${configure.sdk_version}.sdk
+    }
 }
 
-destroot {
-                    xinstall -m 755 -d ${destroot}/Applications/MacPorts/
-                    file copy ${workpath}/build/Release/${name}.app \
-                              ${destroot}/Applications/MacPorts/
+# Maybe it's a good idea not to use a deployment target that's newer than the SDK.
+if {[vercmp ${macosx_deployment_target} ${configure.sdk_version}] > 0} {
+    macosx_deployment_target ${configure.sdk_version}
 }
 
-default_variants +universal
-variant universal {}
-pre-fetch {
-	if {![variant_isset universal]} {
-		return -code error "${name} is only available in a universal version"
-	}
+destroot {
+    copy ${worksrcpath}/build/${xcode.configuration}/${name}.app \
+        ${destroot}${applications_dir}
 }
