diff options
author | Hugo Hörnquist | 2021-01-30 23:25:31 +0100 |
---|---|---|
committer | Hugo Hörnquist | 2022-01-23 21:12:57 +0100 |
commit | 1b69e34288c33f463fd86a6d56561db945b6e089 (patch) | |
tree | 23c659094c19a71a92899f26baff053635acd50e | |
download | aur-1b69e34288c33f463fd86a6d56561db945b6e089.tar.gz |
Initial commit.
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | 0001-love.filesystem.-uses-updated-to-work-with-LOVE-11.0.patch | 153 | ||||
-rw-r--r-- | 0002-Updates-color-values-to-work-with-LOVE-11.0.patch | 162 | ||||
-rw-r--r-- | PKGBUILD | 39 | ||||
-rw-r--r-- | cclite | 2 |
5 files changed, 375 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..736ed9e1762e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = cclite + pkgdesc = A ComputerCraft emulator (from the Minecraft Mod) + pkgver = 2.0.0 + pkgrel = 0 + url = https://github.com/Sorroko/cclite + arch = any + license = Apache + makedepends = ant + depends = love + source = https://github.com/Sorroko/cclite/archive/master.zip + source = cclite + source = 0001-love.filesystem.-uses-updated-to-work-with-LOVE-11.0.patch + source = 0002-Updates-color-values-to-work-with-LOVE-11.0.patch + md5sums = 322727bd61fd1d34799b7b28d7531250 + md5sums = d855dcadcb4d0b0f506c78e34976902f + md5sums = 16f772cbb874e9243d6a5e5871705fd0 + md5sums = 2dc68c42870b1bd1c107b0256d99f425 + +pkgname = cclite diff --git a/0001-love.filesystem.-uses-updated-to-work-with-LOVE-11.0.patch b/0001-love.filesystem.-uses-updated-to-work-with-LOVE-11.0.patch new file mode 100644 index 000000000000..9345ef298e23 --- /dev/null +++ b/0001-love.filesystem.-uses-updated-to-work-with-LOVE-11.0.patch @@ -0,0 +1,153 @@ +From 6235a6c1b5ba06c7c8a635ffc466824e85f8b90e Mon Sep 17 00:00:00 2001 +From: Filipe Reis <filipereis233@gmail.com> +Date: Fri, 15 Feb 2019 19:18:14 +0000 +Subject: [PATCH 1/2] love.filesystem.* uses updated to work with LOVE 11.0 + +--- + src/conf.lua | 2 +- + src/config.lua | 4 ++-- + src/emulator/filesystem.lua | 12 ++++++------ + src/main.lua | 6 +++--- + src/ui/window.lua | 2 +- + 5 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/src/conf.lua b/src/conf.lua +index de01d19..0940c74 100644 +--- a/src/conf.lua ++++ b/src/conf.lua +@@ -1,7 +1,7 @@ + function love.conf(t) + t.title = "ComputerCraft Emulator" + t.author = "Sorroko" +- t.version = "0.9.0" ++ t.version = "11.0" + t.modules.physics = false + t.modules.audio = false + t.modules.sound = false +diff --git a/src/config.lua b/src/config.lua +index eb58c72..fc69a28 100644 +--- a/src/config.lua ++++ b/src/config.lua +@@ -18,7 +18,7 @@ function Config:resetToDefault() + end + + function Config:load() +- if love.filesystem.exists(self.path) then ++ if love.filesystem.getInfo(self.path) then + for line in love.filesystem.lines(self.path) do + key, value = string.match(line,"(.-)=(.-)$") + if key and value then +@@ -33,7 +33,7 @@ end + function Config:save() + local lines, saved_keys = {}, {} + +- if love.filesystem.exists(self.path) then ++ if love.filesystem.getInfo(self.path) then + for line in love.filesystem.lines(self.path) do + key, value = string.match(line,"(.-)=(.-)$") + if self.data[key] then +diff --git a/src/emulator/filesystem.lua b/src/emulator/filesystem.lua +index 065ce9d..b039fe9 100644 +--- a/src/emulator/filesystem.lua ++++ b/src/emulator/filesystem.lua +@@ -14,7 +14,7 @@ function FileSystem.static.deleteTree(sFolder) + + if love.filesystem.isFile(pObject) then + love.filesystem.remove(pObject) +- elseif love.filesystem.isDirectory(pObject) then ++ elseif love.filesystem.getInfo(pObject).type == "directory" then + FileSystem.deleteTree(pObject) + end + end +@@ -26,7 +26,7 @@ function FileSystem.static.copyTree(sFolder, sToFolder) + log("FileSystem -> deleteTree(): source - " .. tostring(sFolder) .. ", destination - " .. tostring(sToFolder)) + FileSystem.deleteTree(sToFolder) -- Overwrite existing file for both copy and move + -- Is this vanilla behaviour or does it merge files? +- if not love.filesystem.isDirectory(sFolder) then ++ if not love.filesystem.getInfo(sFolder).type == "directory" then + love.filesystem.write(sToFolder, love.filesystem.read( sFolder )) + end + local tObjects = love.filesystem.getDirectoryItems(sFolder) +@@ -37,7 +37,7 @@ function FileSystem.static.copyTree(sFolder, sToFolder) + + if love.filesystem.isFile(pObject) then + love.filesystem.write(sToFolder .. "/" .. sObject, love.filesystem.read( pObject )) +- elseif love.filesystem.isDirectory(pObject) then ++ elseif love.filesystem.getInfo(pObject).type == "directory" then + FileSystem.copyTree(pObject) + end + end +@@ -101,7 +101,7 @@ function FileSystem:find(sPath) + _tFlags = v[3] + if startsWith(sPath, _sMount) then + local bPath = string.sub(sPath, #_sMount + 1, -1) +- if love.filesystem.exists(_sPath .. "/" .. bPath) then ++ if love.filesystem.getInfo(_sPath .. "/" .. bPath) then + if self.enableCache then + self.cache.find[sPath] = { _sPath .. "/" .. bPath, _sMount } + end +@@ -124,7 +124,7 @@ function FileSystem:isDirectory(sPath) + local file, mount = self:find(sPath) + if not file then return false end -- false or nil? + +- return love.filesystem.isDirectory(file) ++ return love.filesystem.getInfo(file).type == "directory" + end + + function FileSystem:open( sPath, sMode ) +@@ -260,7 +260,7 @@ function FileSystem:list( sPath ) + if startsWith(sPath, _sMount) then + local bPath = string.sub(sPath, #_sMount + 1, -1) + local fsPath = _sPath .. "/" .. bPath +- if love.filesystem.exists(fsPath) and love.filesystem.isDirectory(fsPath) then ++ if love.filesystem.getInfo(fsPath) and love.filesystem.getInfo(fsPath).type == "directory" then + local items = love.filesystem.getDirectoryItems(fsPath) + for k,_v in pairs(items) do table.insert(res, _v) end + end +diff --git a/src/main.lua b/src/main.lua +index 4f1f573..9ce0906 100644 +--- a/src/main.lua ++++ b/src/main.lua +@@ -38,7 +38,7 @@ function love.load(args) + log("Application starting...") + + love.filesystem.setIdentity( "cclite" ) +- if not love.filesystem.exists( "data/" ) then ++ if not love.filesystem.getInfo("data/") then + log("Creating save directory") + love.filesystem.createDirectory( "data/" ) + end +@@ -57,7 +57,7 @@ function love.load(args) + config:load() + + if PLATFORM ~= "Android" then +- love.keyboard.setKeyRepeat( 0.5, 0.05 ) ++ love.keyboard.setKeyRepeat( true ) -- Love2D no longer sets the interval so... + end + + main_window = Window( "ComputerCraft Emulator" ) +@@ -196,7 +196,7 @@ function love.run() + -- Call update and draw + if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled + +- if love.window and love.graphics and love.window.isCreated() then ++ if love.window and love.graphics and love.window.isOpen() then + love.graphics.clear() + love.graphics.origin() + if love.draw then love.draw() end +diff --git a/src/ui/window.lua b/src/ui/window.lua +index 28baf60..1117c8d 100644 +--- a/src/ui/window.lua ++++ b/src/ui/window.lua +@@ -43,7 +43,7 @@ function Window:create() + local ok = love.window.setMode( self.w, self.h, { + fullscreen = false, + vsync = true, +- fsaa = 0, ++ msaa = 0, + resizable = true, + borderless = false, + minwidth = 200, +-- +2.30.0 + diff --git a/0002-Updates-color-values-to-work-with-LOVE-11.0.patch b/0002-Updates-color-values-to-work-with-LOVE-11.0.patch new file mode 100644 index 000000000000..011b59036f64 --- /dev/null +++ b/0002-Updates-color-values-to-work-with-LOVE-11.0.patch @@ -0,0 +1,162 @@ +From 74728320b253cf6031e722feaccaebc2b7655254 Mon Sep 17 00:00:00 2001 +From: Filipe Reis <filipereis233@gmail.com> +Date: Fri, 15 Feb 2019 19:24:08 +0000 +Subject: [PATCH 2/2] Updates color values to work with LOVE 11.0 + +--- + src/ui/android.lua | 12 +++++----- + src/ui/button.lua | 2 +- + src/ui/tabs.lua | 1 + + src/util.lua | 60 +++++++++++++++++++++++----------------------- + 4 files changed, 38 insertions(+), 37 deletions(-) + +diff --git a/src/ui/android.lua b/src/ui/android.lua +index 5510f7d..5c498ea 100644 +--- a/src/ui/android.lua ++++ b/src/ui/android.lua +@@ -17,7 +17,7 @@ function Android:getHeight() + end + + function Android:draw() +- love.graphics.setColor(172, 232, 250) ++ love.graphics.setColor(172/255, 232/255, 250/255) + love.graphics.rectangle("fill", 0, 0, self:getWidth(), self:getHeight() ) + end + +@@ -45,10 +45,10 @@ function AndroidMenu:postInitialize() + self.ctrl.draw = function(self) + love.graphics.setFont(self.component.font) + if ctrl_state then +- love.graphics.setColor(255, 0, 0) ++ love.graphics.setColor(255/255, 0, 0) + love.graphics.rectangle("fill", self.x, self.y, self.w, self.h ) + end +- love.graphics.setColor(255, 255, 255) ++ love.graphics.setColor(255/255, 255/255, 255/255) + love.graphics.print(self.label, self.x, self.y) + end + +@@ -60,10 +60,10 @@ function AndroidMenu:postInitialize() + self.shift.draw = function(self) + love.graphics.setFont(self.component.font) + if shift_state then +- love.graphics.setColor(255, 0, 0) ++ love.graphics.setColor(255/255, 0, 0) + love.graphics.rectangle("fill", self.x, self.y, self.w, self.h ) + end +- love.graphics.setColor(255, 255, 255) ++ love.graphics.setColor(255/255, 255, 255) + love.graphics.print(self.label, self.x, self.y) + end + end +@@ -81,7 +81,7 @@ function AndroidMenu:getHeight() + end + + function AndroidMenu:draw() +- love.graphics.setColor(63, 81, 181) ++ love.graphics.setColor(63/255, 81/255, 181/255) + love.graphics.rectangle("fill", 0, 0, self:getWidth(), self:getHeight() ) + + self.power:draw() +diff --git a/src/ui/button.lua b/src/ui/button.lua +index f724ee8..7d4f026 100644 +--- a/src/ui/button.lua ++++ b/src/ui/button.lua +@@ -37,6 +37,6 @@ function Button:draw() + --love.graphics.setColor() + --love.graphics.rectangle("fill", self.x, self.y, self.w, self.h ) + love.graphics.setFont(self.component.font) +- love.graphics.setColor(255, 255, 255) ++ love.graphics.setColor(255/255, 255/255, 255/255) + love.graphics.print(self.label, self.x, self.y) + end +diff --git a/src/ui/tabs.lua b/src/ui/tabs.lua +index daf2c77..449d337 100644 +--- a/src/ui/tabs.lua ++++ b/src/ui/tabs.lua +@@ -31,6 +31,7 @@ end + + function Tabs:draw() + -- Draw tab bar ++ -- Not sure what this referes to, but "bodycolor" is never assigned in all of the src folder. (Should probably set to self.bodycolor but that should be unset as well) + love.graphics.setColor(bodycolor) + love.graphics.rectangle("fill", self.x, self.y + self.topHeight, self.width, self.height - self.topHeight) + +diff --git a/src/util.lua b/src/util.lua +index bf41e23..7f808ef 100644 +--- a/src/util.lua ++++ b/src/util.lua +@@ -42,40 +42,40 @@ Util.static.KEYS = { + ["f14"] = 101, ["f15"] = 102, ["f16"] = 103, ["f17"] = 104, ["f18"] = 105 + } + Util.static.COLOUR_RGB = { -- Improved colors +- WHITE = {240, 240, 240}, +- ORANGE = {242, 178, 51}, +- MAGENTA = {229, 127, 216}, +- LIGHT_BLUE = {153, 178, 242}, +- YELLOW = {222, 222, 108}, +- LIME = {127, 204, 25}, +- PINK = {242, 178, 204}, +- GRAY = {76, 76, 76}, +- LIGHT_GRAY = {153, 153, 153}, +- CYAN = {76, 153, 178}, +- PURPLE = {178, 102, 229}, +- BLUE = {37, 49, 146}, +- BROWN = {127, 102, 76}, +- GREEN = {87, 166, 78}, +- RED = {204, 76, 76}, ++ WHITE = {240/255, 240/255, 240/255}, ++ ORANGE = {242/255, 178/255, 51/255}, ++ MAGENTA = {229/255, 127/255, 216/255}, ++ LIGHT_BLUE = {153/255, 178/255, 242/255}, ++ YELLOW = {222/255, 222/255, 108/255}, ++ LIME = {127/255, 204/255, 25/255}, ++ PINK = {242/255, 178/255, 204/255}, ++ GRAY = {76/255, 76/255, 76/255}, ++ LIGHT_GRAY = {153/255, 153/255, 153/255}, ++ CYAN = {76/255, 153/255, 178/255}, ++ PURPLE = {178/255, 102/255, 229/255}, ++ BLUE = {37/255, 49/255, 146/255}, ++ BROWN = {127/255, 102/255, 76/255}, ++ GREEN = {87/255, 166/255, 78/255}, ++ RED = {204/255, 76/255, 76/255}, + BLACK = {0, 0, 0}, + } + + Util.static.COLOUR_RGB_CC = { -- Accurate cc colors +- WHITE = {255, 255, 255}, --Colors from GravityScore. Updated by awsmazinggenius. +- ORANGE = {235, 136, 68}, +- MAGENTA = {195, 84, 205}, +- LIGHT_BLUE = {102, 137, 211}, +- YELLOW = {222, 222, 108}, +- LIME = {65, 205, 52}, +- PINK = {216, 129, 152}, +- GRAY = {67, 67, 67}, +- LIGHT_GRAY = {153, 153, 153}, +- CYAN = {40, 118, 151}, +- PURPLE = {123, 47, 190}, +- BLUE = {37, 49, 146}, +- BROWN = {81, 48, 26}, +- GREEN = {59, 81, 26}, +- RED = {179, 49, 44}, ++ WHITE = {255/255, 255/255, 255/255}, --Colors from GravityScore. Updated by awsmazinggenius. ++ ORANGE = {235/255, 136/255, 68/255}, ++ MAGENTA = {195/255, 84/255, 205/255}, ++ LIGHT_BLUE = {102/255, 137/255, 211/255}, ++ YELLOW = {222/255, 222/255, 108/255}, ++ LIME = {65/255, 205/255, 52/255}, ++ PINK = {216/255, 129/255, 152/255}, ++ GRAY = {67/255, 67/255, 67/255}, ++ LIGHT_GRAY = {153/255, 153/255, 153/255}, ++ CYAN = {40/255, 118/255, 151/255}, ++ PURPLE = {123/255, 47/255, 190/255}, ++ BLUE = {37/255, 49/255, 146/255}, ++ BROWN = {81/255, 48/255, 26/255}, ++ GREEN = {59/255, 81/255, 26/255}, ++ RED = {179/255, 49/255, 44/255}, + BLACK = {0, 0, 0}, + } + +-- +2.30.0 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..9007a69eddff --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,39 @@ +# Maintainer: Hugo Hörnquist <hugo@lysator.liu.se> + +pkgname=cclite +pkgver=2.0.0 +pkgrel=0 +pkgdesc="A ComputerCraft emulator (from the Minecraft Mod)" +arch=('any') +license=('Apache') +makedepends=('ant') +depends=('love') +url='https://github.com/Sorroko/cclite' +source=("$url/archive/master.zip" + 'cclite' + '0001-love.filesystem.-uses-updated-to-work-with-LOVE-11.0.patch' + '0002-Updates-color-values-to-work-with-LOVE-11.0.patch') +md5sums=('322727bd61fd1d34799b7b28d7531250' + 'd855dcadcb4d0b0f506c78e34976902f' + '16f772cbb874e9243d6a5e5871705fd0' + '2dc68c42870b1bd1c107b0256d99f425') + +prepare() { + cd "$srcdir/cclite-master" + # Patches from a pull request on GitHub + # https://github.com/Sorroko/cclite/pull/64 + git apply "$srcdir/0001-love.filesystem.-uses-updated-to-work-with-LOVE-11.0.patch" + git apply "$srcdir/0002-Updates-color-values-to-work-with-LOVE-11.0.patch" +} + +build() { + cd "$srcdir/cclite-master" + ant love +} + +package() { + cd $pkgdir + install -D -m 644 -t usr/share/doc/cclite/ "$srcdir/cclite-master/README.md" + install -D -m 644 -t usr/lib/cclite/ "$srcdir/cclite-master/dist/CCLite-2.2.0.love" + install -D -m 755 -t usr/bin/ "$srcdir/cclite" +} diff --git a/cclite b/cclite new file mode 100644 index 000000000000..b822d28d2f6d --- /dev/null +++ b/cclite @@ -0,0 +1,2 @@ +#!/bin/sh +love /usr/lib/cclite/CCLite-2.2.0.love |