Minetest Package Manager [WIP]

Post Reply
User avatar
rubenwardy
Moderator
Posts: 6288
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Minetest Package Manager [WIP]

by rubenwardy » Post

Minetest Package Manager (mtpm) is a CLI tool and a Lua library to assist with the installation of Mods, Modpacks and Subgames. MTPM is based (loosely) on the existing modmanager in Minetest and the aim is for it to replace it as a more robust and flexible piece of code.

License: LGPL 2.1 or Later
Github Repository | Download

Install

Code: Select all

$ sudo apt-get install lua5.1 luarocks libzzip-dev
$ sudo luarocks install luazip
$ sudo luarocks install luafilesystem
$ sudo luarocks install luajson
# Alternatively you could use sudo luarocks install

$ git clone https://github.com/rubenwardy/mtpm/
$ cd mtpm

# You could skip this and use "./mtpm.lua" instead of "mtpm"
$ sudo make install

# You can skip this line if minetest is in ~/.minetest/
$ mtpm set minetest_root /path/to/minetest/
Usage

Code: Select all

# Install multiple packages
$ mtpm install homedecor food tutorial

# Specify the type of a package
$ mtpm install food#mod
$ mtpm install tutorial#subgame

# Specify the author
$ mtpm install tenplus1/mobs
$ mtpm install PilzAdam/mobs

# Specify the repository
$ mtpm install carts@ModSearch
$ mtpm install boost_cart@minetest-bower
$ mtpm install technic_game@mtpm_sg

# From github
$ mtpm install PilzAdam/farming_plus@github
$ mtpm install https://github.com/PilzAdam/farming_plus

# From url
$ mtpm install https://example.com/archive.zip

# From file
$ mtpm install archive.zip
List of supported package repositories
To Do
  • Test windows support
  • uninstall
Last edited by rubenwardy on Wed Aug 26, 2015 16:54, edited 8 times in total.

User avatar
benrob0329
Member
Posts: 1337
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: Minetest Package Manager

by benrob0329 » Post

I'll have to pit this on my server! Can this keep mods up to date as well?
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA

User avatar
benrob0329
Member
Posts: 1337
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: Minetest Package Manager

by benrob0329 » Post

I get the following error:

Code: Select all

root@localhost:~# mtpm
/usr/bin/lua: error loading module 'zip' from file '/root/.luarocks/lib/lua/5.1/zip.so':
	/root/.luarocks/lib/lua/5.1/zip.so: undefined symbol: lua_objlen
stack traceback:
	[C]: in ?
	[C]: in function 'require'
	/usr/local/share/mtpm/core.lua:86: in function </usr/local/share/mtpm/core.lua:82>
	/usr/local/share/mtpm/core.lua:82: in main chunk
	[C]: in function 'dofile'
	/usr/local/bin/mtpm:95: in function 'init'
	/usr/local/bin/mtpm:187: in main chunk
	[C]: in ?
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA

User avatar
rubenwardy
Moderator
Posts: 6288
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Minetest Package Manager

by rubenwardy » Post

benrob0329 wrote:I get the following error:

Code: Select all

root@localhost:~# mtpm
/usr/bin/lua: error loading module 'zip' from file '/root/.luarocks/lib/lua/5.1/zip.so':
	/root/.luarocks/lib/lua/5.1/zip.so: undefined symbol: lua_objlen
stack traceback:
	[C]: in ?
	[C]: in function 'require'
	/usr/local/share/mtpm/core.lua:86: in function </usr/local/share/mtpm/core.lua:82>
	/usr/local/share/mtpm/core.lua:82: in main chunk
	[C]: in function 'dofile'
	/usr/local/bin/mtpm:95: in function 'init'
	/usr/local/bin/mtpm:187: in main chunk
	[C]: in ?
maybe try installing with sudo luarocks install instead of luarocks install --local?

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

Re: Minetest Package Manager

by Evergreen » Post

I tried installing luazip globally with sudo luarocks install, but it gives me a compilation error. This happens with both lua 5.3 and lua 5.2. Here is that error:

Code: Select all

gcc -O2 -fPIC -I/usr/include -c src/luazip.c -o src/luazip.o -I/usr/include
src/luazip.c: In function ‘zip_openfile’:
src/luazip.c:160:9: warning: implicit declaration of function ‘luaL_getn’ [-Wimplicit-function-declaration]
     n = luaL_getn(L, 2);
         ^
src/luazip.c: In function ‘read_line’:
src/luazip.c:347:15: warning: implicit declaration of function ‘lua_strlen’ [-Wimplicit-function-declaration]
       return (lua_strlen(L, -1) > 0);  /* check whether read something */
               ^
src/luazip.c: In function ‘ff_seek’:
src/luazip.c:456:17: warning: implicit declaration of function ‘luaL_optlong’ [-Wimplicit-function-declaration]
   long offset = luaL_optlong(L, 3, 0);
                 ^
src/luazip.c: At top level:
src/luazip.c:472:14: error: unknown type name ‘luaL_reg’
 static const luaL_reg ziplib[] = {
              ^
src/luazip.c:473:3: warning: braces around scalar initializer
   {"open", zip_open},
   ^
src/luazip.c:473:3: note: (near initialization for ‘ziplib[0]’)
src/luazip.c:473:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"open", zip_open},
    ^
src/luazip.c:473:4: note: (near initialization for ‘ziplib[0]’)
src/luazip.c:473:4: error: initializer element is not computable at load time
src/luazip.c:473:4: note: (near initialization for ‘ziplib[0]’)
src/luazip.c:473:12: warning: excess elements in scalar initializer
   {"open", zip_open},
            ^
src/luazip.c:473:12: note: (near initialization for ‘ziplib[0]’)
src/luazip.c:474:3: warning: braces around scalar initializer
   {"close", zip_close},
   ^
src/luazip.c:474:3: note: (near initialization for ‘ziplib[1]’)
src/luazip.c:474:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"close", zip_close},
    ^
src/luazip.c:474:4: note: (near initialization for ‘ziplib[1]’)
src/luazip.c:474:4: error: initializer element is not computable at load time
src/luazip.c:474:4: note: (near initialization for ‘ziplib[1]’)
src/luazip.c:474:13: warning: excess elements in scalar initializer
   {"close", zip_close},
             ^
src/luazip.c:474:13: note: (near initialization for ‘ziplib[1]’)
src/luazip.c:475:3: warning: braces around scalar initializer
   {"type", zip_type},
   ^
src/luazip.c:475:3: note: (near initialization for ‘ziplib[2]’)
src/luazip.c:475:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"type", zip_type},
    ^
src/luazip.c:475:4: note: (near initialization for ‘ziplib[2]’)
src/luazip.c:475:4: error: initializer element is not computable at load time
src/luazip.c:475:4: note: (near initialization for ‘ziplib[2]’)
src/luazip.c:475:12: warning: excess elements in scalar initializer
   {"type", zip_type},
            ^
src/luazip.c:475:12: note: (near initialization for ‘ziplib[2]’)
src/luazip.c:477:3: warning: braces around scalar initializer
   {"openfile", zip_openfile},
   ^
src/luazip.c:477:3: note: (near initialization for ‘ziplib[3]’)
src/luazip.c:477:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"openfile", zip_openfile},
    ^
src/luazip.c:477:4: note: (near initialization for ‘ziplib[3]’)
src/luazip.c:477:4: error: initializer element is not computable at load time
src/luazip.c:477:4: note: (near initialization for ‘ziplib[3]’)
src/luazip.c:477:16: warning: excess elements in scalar initializer
   {"openfile", zip_openfile},
                ^
src/luazip.c:477:16: note: (near initialization for ‘ziplib[3]’)
src/luazip.c:478:3: warning: braces around scalar initializer
   {NULL, NULL}
   ^
src/luazip.c:478:3: note: (near initialization for ‘ziplib[4]’)
src/luazip.c:481:14: error: unknown type name ‘luaL_reg’
 static const luaL_reg flib[] = {
              ^
src/luazip.c:482:3: warning: braces around scalar initializer
   {"open", f_open},
   ^
src/luazip.c:482:3: note: (near initialization for ‘flib[0]’)
src/luazip.c:482:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"open", f_open},
    ^
src/luazip.c:482:4: note: (near initialization for ‘flib[0]’)
src/luazip.c:482:4: error: initializer element is not computable at load time
src/luazip.c:482:4: note: (near initialization for ‘flib[0]’)
src/luazip.c:482:12: warning: excess elements in scalar initializer
   {"open", f_open},
            ^
src/luazip.c:482:12: note: (near initialization for ‘flib[0]’)
src/luazip.c:483:3: warning: braces around scalar initializer
   {"close", zip_close},
   ^
src/luazip.c:483:3: note: (near initialization for ‘flib[1]’)
src/luazip.c:483:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"close", zip_close},
    ^
src/luazip.c:483:4: note: (near initialization for ‘flib[1]’)
src/luazip.c:483:4: error: initializer element is not computable at load time
src/luazip.c:483:4: note: (near initialization for ‘flib[1]’)
src/luazip.c:483:13: warning: excess elements in scalar initializer
   {"close", zip_close},
             ^
src/luazip.c:483:13: note: (near initialization for ‘flib[1]’)
src/luazip.c:484:3: warning: braces around scalar initializer
   {"files", f_files},
   ^
src/luazip.c:484:3: note: (near initialization for ‘flib[2]’)
src/luazip.c:484:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"files", f_files},
    ^
src/luazip.c:484:4: note: (near initialization for ‘flib[2]’)
src/luazip.c:484:4: error: initializer element is not computable at load time
src/luazip.c:484:4: note: (near initialization for ‘flib[2]’)
src/luazip.c:484:13: warning: excess elements in scalar initializer
   {"files", f_files},
             ^
src/luazip.c:484:13: note: (near initialization for ‘flib[2]’)
src/luazip.c:485:3: warning: braces around scalar initializer
   {"__gc", zip_gc},
   ^
src/luazip.c:485:3: note: (near initialization for ‘flib[3]’)
src/luazip.c:485:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"__gc", zip_gc},
    ^
src/luazip.c:485:4: note: (near initialization for ‘flib[3]’)
src/luazip.c:485:4: error: initializer element is not computable at load time
src/luazip.c:485:4: note: (near initialization for ‘flib[3]’)
src/luazip.c:485:12: warning: excess elements in scalar initializer
   {"__gc", zip_gc},
            ^
src/luazip.c:485:12: note: (near initialization for ‘flib[3]’)
src/luazip.c:486:3: warning: braces around scalar initializer
   {"__tostring", zip_tostring},
   ^
src/luazip.c:486:3: note: (near initialization for ‘flib[4]’)
src/luazip.c:486:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"__tostring", zip_tostring},
    ^
src/luazip.c:486:4: note: (near initialization for ‘flib[4]’)
src/luazip.c:486:4: error: initializer element is not computable at load time
src/luazip.c:486:4: note: (near initialization for ‘flib[4]’)
src/luazip.c:486:18: warning: excess elements in scalar initializer
   {"__tostring", zip_tostring},
                  ^
src/luazip.c:486:18: note: (near initialization for ‘flib[4]’)
src/luazip.c:487:3: warning: braces around scalar initializer
   {NULL, NULL}
   ^
src/luazip.c:487:3: note: (near initialization for ‘flib[5]’)
src/luazip.c:490:14: error: unknown type name ‘luaL_reg’
 static const luaL_reg fflib[] = {
              ^
src/luazip.c:491:3: warning: braces around scalar initializer
   {"read", ff_read},
   ^
src/luazip.c:491:3: note: (near initialization for ‘fflib[0]’)
src/luazip.c:491:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"read", ff_read},
    ^
src/luazip.c:491:4: note: (near initialization for ‘fflib[0]’)
src/luazip.c:491:4: error: initializer element is not computable at load time
src/luazip.c:491:4: note: (near initialization for ‘fflib[0]’)
src/luazip.c:491:12: warning: excess elements in scalar initializer
   {"read", ff_read},
            ^
src/luazip.c:491:12: note: (near initialization for ‘fflib[0]’)
src/luazip.c:492:3: warning: braces around scalar initializer
   {"close", ff_close},
   ^
src/luazip.c:492:3: note: (near initialization for ‘fflib[1]’)
src/luazip.c:492:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"close", ff_close},
    ^
src/luazip.c:492:4: note: (near initialization for ‘fflib[1]’)
src/luazip.c:492:4: error: initializer element is not computable at load time
src/luazip.c:492:4: note: (near initialization for ‘fflib[1]’)
src/luazip.c:492:13: warning: excess elements in scalar initializer
   {"close", ff_close},
             ^
src/luazip.c:492:13: note: (near initialization for ‘fflib[1]’)
src/luazip.c:493:3: warning: braces around scalar initializer
   {"seek", ff_seek},
   ^
src/luazip.c:493:3: note: (near initialization for ‘fflib[2]’)
src/luazip.c:493:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"seek", ff_seek},
    ^
src/luazip.c:493:4: note: (near initialization for ‘fflib[2]’)
src/luazip.c:493:4: error: initializer element is not computable at load time
src/luazip.c:493:4: note: (near initialization for ‘fflib[2]’)
src/luazip.c:493:12: warning: excess elements in scalar initializer
   {"seek", ff_seek},
            ^
src/luazip.c:493:12: note: (near initialization for ‘fflib[2]’)
src/luazip.c:494:3: warning: braces around scalar initializer
   {"lines", ff_lines},
   ^
src/luazip.c:494:3: note: (near initialization for ‘fflib[3]’)
src/luazip.c:494:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"lines", ff_lines},
    ^
src/luazip.c:494:4: note: (near initialization for ‘fflib[3]’)
src/luazip.c:494:4: error: initializer element is not computable at load time
src/luazip.c:494:4: note: (near initialization for ‘fflib[3]’)
src/luazip.c:494:13: warning: excess elements in scalar initializer
   {"lines", ff_lines},
             ^
src/luazip.c:494:13: note: (near initialization for ‘fflib[3]’)
src/luazip.c:495:3: warning: braces around scalar initializer
   {"__gc", ff_gc},
   ^
src/luazip.c:495:3: note: (near initialization for ‘fflib[4]’)
src/luazip.c:495:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"__gc", ff_gc},
    ^
src/luazip.c:495:4: note: (near initialization for ‘fflib[4]’)
src/luazip.c:495:4: error: initializer element is not computable at load time
src/luazip.c:495:4: note: (near initialization for ‘fflib[4]’)
src/luazip.c:495:12: warning: excess elements in scalar initializer
   {"__gc", ff_gc},
            ^
src/luazip.c:495:12: note: (near initialization for ‘fflib[4]’)
src/luazip.c:496:3: warning: braces around scalar initializer
   {"__tostring", ff_tostring},
   ^
src/luazip.c:496:3: note: (near initialization for ‘fflib[5]’)
src/luazip.c:496:4: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   {"__tostring", ff_tostring},
    ^
src/luazip.c:496:4: note: (near initialization for ‘fflib[5]’)
src/luazip.c:496:4: error: initializer element is not computable at load time
src/luazip.c:496:4: note: (near initialization for ‘fflib[5]’)
src/luazip.c:496:18: warning: excess elements in scalar initializer
   {"__tostring", ff_tostring},
                  ^
src/luazip.c:496:18: note: (near initialization for ‘fflib[5]’)
src/luazip.c:499:3: warning: braces around scalar initializer
   {NULL, NULL}
   ^
src/luazip.c:499:3: note: (near initialization for ‘fflib[6]’)
src/luazip.c: In function ‘createmeta’:
src/luazip.c:524:3: warning: implicit declaration of function ‘luaL_openlib’ [-Wimplicit-function-declaration]
   luaL_openlib(L, NULL, flib, 0);
   ^

Error: Build error: Failed compiling object src/luazip.o
Back from the dead!

User avatar
rubenwardy
Moderator
Posts: 6288
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Minetest Package Manager

by rubenwardy » Post

I've only ever used Lua 5.1, as that's what Minetest uses. This is turning into a PITA, maybe I'll just full back to os.execute and unzip.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

Re: Minetest Package Manager

by Evergreen » Post

rubenwardy wrote:I've only ever used Lua 5.1, as that's what Minetest uses. This is turning into a PITA, maybe I'll just full back to os.execute and unzip.
Ah, it does work with lua 5.1. Darn you arch linux with your bleeding edge software! (just kidding, I like having bleeding edge software)
Back from the dead!

User avatar
benrob0329
Member
Posts: 1337
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: Minetest Package Manager

by benrob0329 » Post

rubenwardy wrote:
benrob0329 wrote:I get the following error:

Code: Select all

root@localhost:~# mtpm
/usr/bin/lua: error loading module 'zip' from file '/root/.luarocks/lib/lua/5.1/zip.so':
	/root/.luarocks/lib/lua/5.1/zip.so: undefined symbol: lua_objlen
stack traceback:
	[C]: in ?
	[C]: in function 'require'
	/usr/local/share/mtpm/core.lua:86: in function </usr/local/share/mtpm/core.lua:82>
	/usr/local/share/mtpm/core.lua:82: in main chunk
	[C]: in function 'dofile'
	/usr/local/bin/mtpm:95: in function 'init'
	/usr/local/bin/mtpm:187: in main chunk
	[C]: in ?
maybe try installing with sudo luarocks install instead of luarocks install --local?
I didn't use -local.....oh well, back to manually updating mods!
Social: YouTube Peertube Matrix Room: #minetest:matrix.org | Games: The Infinite IKEA

User avatar
rubenwardy
Moderator
Posts: 6288
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Minetest Package Manager

by rubenwardy » Post

you definitely installed libzzip-dev?

User avatar
addi
Member
Posts: 665
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

Re: Minetest Package Manager

by addi » Post

Can you please give detailed instructions how to install and integrate this into minetest?
I tried to copy it into 'minetest\builtin\mainmenu' , but it does not work. Also could you provide a screenshot?

User avatar
rubenwardy
Moderator
Posts: 6288
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Minetest Package Manager

by rubenwardy » Post

It doesn't work in Minetest yet, it an eventual aim which is incorporated in its design.

User avatar
jogag
Member
Posts: 106
Joined: Wed Aug 12, 2015 18:32
GitHub: jogag
IRC: jogag
In-game: jogag
Location: Online

Re: Minetest Package Manager

by jogag » Post

rubenwardy wrote:It doesn't work in Minetest yet, it an eventual aim which is incorporated in its design.
Minetest has already a mod store, but it's based on MMDB, which is dead. So we need to upgrade it.

User avatar
rubenwardy
Moderator
Posts: 6288
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Minetest Package Manager

by rubenwardy » Post

jogag wrote:
rubenwardy wrote:It doesn't work in Minetest yet, it an eventual aim which is incorporated in its design.
Minetest has already a mod store, but it's based on MMDB, which is dead. So we need to upgrade it.
I know, this code is based partially on the existing mod store (the back end, at least).

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests