Cleaning up libpng premake to be isolated/stand-alone.

libpng_premake is now standlone!

You should just need to dofile the premake5_libpng.lua file. This will expose a variable called "libpng" which you can then use to point to include dirs, see how the viewer premake does this:
https://github.com/rive-app/rive/blob/3a8b2203e2ed1b0c57697c534415c6dede99b792/packages/runtime/viewer/build/premake5_viewer.lua#L117

You link to it by name:
https://github.com/rive-app/rive/blob/3a8b2203e2ed1b0c57697c534415c6dede99b792/packages/runtime/viewer/build/premake5_viewer.lua#L124

This should automatically setup the dependency tree for building in correct order, but I found that on some versions of I premake I need to force the order by telling the project it depends on a dependency like so:
https://github.com/rive-app/rive/blob/3a8b2203e2ed1b0c57697c534415c6dede99b792/packages/runtime/viewer/build/premake5_viewer.lua#L26

This just ensures that libpng always builds before rive_viewer.

Diffs=
404a04d35 Cleaning up libpng premake to be isolated/stand-alone. (#4713)
diff --git a/.rive_head b/.rive_head
index 295e33b..016e81c 100644
--- a/.rive_head
+++ b/.rive_head
@@ -1 +1 @@
-599748ccb9fb225627cc57660d53bdfb42958d77
+404a04d352143cd24760ada60546771eb1a9bd7e
diff --git a/dependencies/macosx/get_libpng.sh b/dependencies/macosx/get_libpng.sh
deleted file mode 100755
index 8598ccc..0000000
--- a/dependencies/macosx/get_libpng.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [[ -z "${DEPENDENCIES}" ]]; then
-    echo "DEPENDENCIES env variable must be set. This script is usually called by other scripts."
-    exit 1
-fi
-
-pushd $DEPENDENCIES
-LIBPNG_REPO=https://github.com/glennrp/libpng
-LIBPNG_STABLE_BRANCH=libpng16
-
-if [ ! -d libpng ]; then
-    echo "Cloning libpng."
-    git clone $LIBPNG_REPO
-fi
-
-pushd libpng
-git checkout $LIBPNG_STABLE_BRANCH && git fetch && git pull
-mv scripts/pnglibconf.h.prebuilt pnglibconf.h
-popd
-
-ZLIB_REPO=https://github.com/madler/zlib
-ZLIB_STABLE_BRANCH=master
-
-if [ ! -d zlib ]; then
-    echo "Cloning zlib."
-    git clone $ZLIB_REPO
-fi
-
-pushd zlib
-git checkout $ZLIB_STABLE_BRANCH && git fetch && git pull
-popd
-
-popd
diff --git a/dependencies/premake5_libpng.lua b/dependencies/premake5_libpng.lua
index 72e7435..2844fd9 100644
--- a/dependencies/premake5_libpng.lua
+++ b/dependencies/premake5_libpng.lua
@@ -1,6 +1,5 @@
-dependencies = os.getenv('DEPENDENCIES')
-
-libpng = dependencies .. '/libpng'
+local dependency = require 'dependency'
+libpng = dependency.github('glennrp/libpng', 'libpng16')
 
 project 'libpng'
 do
@@ -14,9 +13,9 @@
         '-fno-exceptions',
         '-fno-rtti'
     }
+    prebuildcommands {'{COPY} ' .. libpng .. '/scripts/pnglibconf.h.prebuilt ' .. libpng .. '/pnglibconf.h'}
     includedirs {
         './',
-        dependencies,
         libpng
     }
     files {
@@ -47,7 +46,7 @@
     end
 end
 
-zlib = dependencies .. '/zlib'
+zlib = dependency.github('madler/zlib', '04f42ceca40f73e2978b50e93806c2a18c1281fc')
 
 project 'zlib'
 do
diff --git a/viewer/build/macosx/build_viewer.sh b/viewer/build/macosx/build_viewer.sh
index 9dcac0d..9038efa 100755
--- a/viewer/build/macosx/build_viewer.sh
+++ b/viewer/build/macosx/build_viewer.sh
@@ -40,12 +40,6 @@
     popd
 fi
 
-if [[ $RENDERER = "tess" ]] && [[ ! -d "$DEPENDENCIES/libpng" ]]; then
-    pushd $DEPENDENCIES_SCRIPTS
-    ./get_libpng.sh
-    popd
-fi
-
 if [ $RENDERER = "skia" ]; then
     pushd ../../../skia/renderer/build/macosx
     ./build_skia_renderer.sh text $@
diff --git a/viewer/build/premake5_viewer.lua b/viewer/build/premake5_viewer.lua
index d01b75e..26cce3d 100644
--- a/viewer/build/premake5_viewer.lua
+++ b/viewer/build/premake5_viewer.lua
@@ -10,7 +10,6 @@
 rive_tess = '../../tess'
 rive_skia = '../../skia'
 skia = dependencies .. '/skia'
-libpng = dependencies .. '/libpng'
 
 if _OPTIONS.renderer == 'tess' then
     dofile(path.join(path.getabsolute(dependencies) .. '/../..', 'premake5_libpng.lua'))