Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpkg/glibc: global update #317

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion get-build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Script that installs build-package.sh to compile glibc packages

BRANCH="master"
BRANCH="adding-glibc32-prefix"

git clone --depth 1 -b ${BRANCH} --single-branch https://github.com/termux/termux-packages.git

Expand Down
13 changes: 13 additions & 0 deletions gpkg/gcc-libs-dev-glibc32/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
TERMUX_PKG_HOMEPAGE=https://gcc.gnu.org/
TERMUX_PKG_DESCRIPTION="Runtime libraries shipped by GCC on a 32-bit basis (temporary package)"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@termux-pacman"
TERMUX_PKG_VERSION=14.2.1
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_BUILD32=true
TERMUX_PKG_BLACKLISTED_ARCHES="arm, i686"

termux_step_make_install32() {
mkdir -p ${TERMUX_LIB32_PATH}
cp -r ${CGCT_DIR}/${TERMUX_ARCH}/lib/lib* ${TERMUX_LIB32_PATH}
}
11 changes: 0 additions & 11 deletions gpkg/glibc/_Fork.c.patch

This file was deleted.

16 changes: 0 additions & 16 deletions gpkg/glibc/accept.c.patch

This file was deleted.

36 changes: 15 additions & 21 deletions gpkg/glibc/android_passwd_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
structures are created.
*/

#ifndef _ANDROID_PASSWD_GROUP
#define _ANDROID_PASSWD_GROUP

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "android_ids.h"
#include "android_passwd_group.h"

struct android_id_info * find_android_id_info_by_id(unsigned id) {
Expand Down Expand Up @@ -67,7 +63,7 @@ int is_valid_id_android(id_t id, int is_group) {
return 0;
}

static id_t oem_id_from_name_android(const char* name) {
id_t oem_id_from_name_android(const char* name) {
unsigned int id;
if (sscanf(name, "oem_%u", &id) != 1) {
return 0;
Expand All @@ -78,7 +74,7 @@ static id_t oem_id_from_name_android(const char* name) {
return (id_t)id;
}

static id_t app_id_from_name_android(const char* name, int is_group) {
id_t app_id_from_name_android(const char* name, int is_group) {
char* end;
unsigned long userid;
struct android_id_info* info;
Expand All @@ -87,7 +83,7 @@ static id_t app_id_from_name_android(const char* name, int is_group) {
if (is_group && name[0] == 'a' && name[1] == 'l' && name[2] == 'l') {
end = malloc(strlen(name));
for (int i=3; i<strlen(name); i++)
sprintf(end, "%s%c", end, name[i]);
strncat(end, &name[i], 1);
userid = 0;
is_shared_gid = 1;
} else if (name[0] == 'u' && isdigit(name[1])) {
Expand Down Expand Up @@ -186,27 +182,27 @@ void get_name_by_gid_android(gid_t gid, char *name_g) {
}
}

struct passwd * get_passwd_android(char* name, uid_t uid) {
struct passwd * get_passwd_android(const char* name, uid_t uid) {
static struct passwd res;

res.pw_name = name;
res.pw_passwd = "*";
res.pw_name = (char *)name;
res.pw_passwd = (char *)"*";
res.pw_uid = uid;
res.pw_gid = uid;
res.pw_gecos = "";
res.pw_dir = APP_HOME_DIR;
res.pw_shell = APP_PREFIX_DIR "/bin/login";
res.pw_gecos = (char *)"";
res.pw_dir = (char *)APP_HOME_DIR;
res.pw_shell = (char *)(APP_PREFIX_DIR "/bin/login");

return &res;
}

struct group * get_group_android(char* name, gid_t gid) {
struct group * get_group_android(const char* name, gid_t gid) {
static struct group res;

res.gr_name = name;
res.gr_name = (char *)name;
res.gr_passwd = NULL;
res.gr_gid = gid;
res.gr_mem = (char *[2]){(char *)name, NULL};
res.gr_mem = *(char **[2]){(char **)name, NULL};

return &res;
}
Expand Down Expand Up @@ -243,7 +239,7 @@ struct group * getgrgid_android(gid_t gid) {
return get_group_android(name_res, gid);
}

struct passwd * getpwnam_android(char* name) {
struct passwd * getpwnam_android(const char* name) {
uid_t uid;
struct android_id_info* info;

Expand All @@ -262,7 +258,7 @@ struct passwd * getpwnam_android(char* name) {
return NULL;
}

struct group * getgrnam_android(char* name) {
struct group * getgrnam_android(const char* name) {
gid_t gid;
struct android_id_info* info;

Expand All @@ -280,5 +276,3 @@ struct group * getgrnam_android(char* name) {

return NULL;
}

#endif // _ANDROID_PASSWD_GROUP
13 changes: 6 additions & 7 deletions gpkg/glibc/android_passwd_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@

#include <pwd.h>
#include <grp.h>
#include "android_ids.h"

struct android_id_info * find_android_id_info_by_id(unsigned id);
struct android_id_info * find_android_id_info_by_name(const char* name);
int is_oem_id_android(id_t id);
int is_valid_id_android(id_t id, int is_group);
static id_t oem_id_from_name_android(const char* name);
static id_t app_id_from_name_android(const char* name, int is_group);
id_t oem_id_from_name_android(const char* name);
id_t app_id_from_name_android(const char* name, int is_group);
void get_name_by_uid_android(uid_t uid, char *name_u);
void get_name_by_gid_android(gid_t gid, char *name_g);
struct passwd * get_passwd_android(char* name, uid_t uid);
struct group * get_group_android(char* name, gid_t gid);
struct passwd * get_passwd_android(const char* name, uid_t uid);
struct group * get_group_android(const char* name, gid_t gid);
struct passwd * getpwuid_android(uid_t uid);
struct group * getgrgid_android(gid_t gid);
struct passwd * getpwnam_android(char* name);
struct group * getgrnam_android(char* name);
struct passwd * getpwnam_android(const char* name);
struct group * getgrnam_android(const char* name);

#endif // _ANDROID_PASSWD_GROUP_H
Loading